@shippack/isbn-verify
v1.5.1
Published
Verify ISBN string format and check digit.
Downloads
91
Readme
ISBN Verify
Verify ISBN string format and check digit.
Demo
Examples
import IsbnVerify from '@saekitominaga/isbn-verify';
const isbnVerify = new IsbnVerify('978-4-06-519981-0');
isbnVerify.isValid(); // false
isbnVerify.isIsbn10(); // false
isbnVerify.isIsbn13(); // true
isbnVerify.isIsbn13({ check_digit: true }); // false
isbnVerify.verifyFormat(); // true
isbnVerify.verifyCheckDigit(); // false
Constructor
new IsbnVerify(isbn: string, strict = false)
Parameters
Methods
Arguments of isIsbn13()
and isIsbn10()
method
interface isOption {
check_digit?: boolean; // Verify format including check digit
}
* isIsbnXX({ check_digit: true })
has the same effect as isIsbnXX() && isValid()
.