Swiftpack.co - jens-andre/isbn as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by jens-andre.
jens-andre/isbn 2.0.3
Represents a International Standard Book Number
⭐️ 2
🕓 1 year ago
macOS
.package(url: "https://github.com/jens-andre/isbn.git", from: "2.0.3")

ISBN

Represents a International Standard Book Number, the unique identification of books and other independent publications with editorial content.

Declaration

struct ISBN

Initializers

init?(Int)

Create a ISBN with a given GTIN representation; returns nil if the ISBN is not valid

init?(String)

Create a ISBN with a given string representation; returns nil if the ISBN is not valid

Instance Properties

let elements: Elements

The prefix, group, registrant, publication and check digit elements of the ISBN

let groupName: String

The registration group name of the ISBN

let gtin: Int

The Global Trade Item Number

let isbnString: String

The string representation of the ISBN

Type Methods

static func hyphenated(String) -> String?

Returns a string representation of a ISBN with hyphens

static func hyphenated(Int) -> String?

Returns a string representation of a ISBN with hyphens from a given GTIN representation

static func isValid(Int) -> Bool

Validates a given GTIN representation of a ISBN

static func isValid(String) -> Bool

Validates a given string representation of a ISBN

Relationships

Conforms to

  • Swift.LosslessStringConvertible
  • Swift.Decodable
  • Swift.Encodable
  • Swift.Equatable

License

MIT License.

Copyright (c) 2022 jens-andre

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

GitHub

link
Stars: 2
Last commit: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

1 year ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics