How to use the isISBN function from validator
Find comprehensive JavaScript validator.isISBN code examples handpicked from public code repositorys.
123 124 125 126 127 128 129 130 131 132
}, date: function(x) { check(x, "a date", validator.isDate(x)); }, isbn: function(x) { check(x, "a book number", validator.isISBN(x)); }, json: function(x) { check(x, "a JSON object", validator.isJSON(x)); }
2
4
0
GitHub: bevacqua/infer
239 240 241 242 243 244 245 246 247 248
}; validator.isISBN = function (str, version) { version = validator.toString(version); if (!version) { return validator.isISBN(str, 10) || validator.isISBN(str, 13); } var sanitized = str.replace(/[\s-]+/g, '') , checksum = 0, i; if (version === '10') {
2
3
4
155 156 157 158 159 160 161 162 163 164
} return true; }, isISBN: function(rule, value) { if (rule) { return validator.isISBN(value); } return true; }, isJSON: function(rule, value) {
0
2
2
+ 5 other calls in file
75 76 77 78 79 80 81 82 83 84
isIP: function (str, version) { return validator.isIP(str, typeof version !== 'boolean' ? version : undefined); }, // isISBN(str [, version]) - check if the string is an ISBN (version 10 or 13). isISBN: function (str, version) { return validator.isISBN(str, typeof version !== 'boolean' ? version : undefined); }, // isISIN(str) - check if the string is an ISIN (stock/security identifier). isISIN: validator.isISIN, // isIn(str, values) - check if the string is in a array of allowed values.
0
1
3
+ 17 other calls in file
122 123 124 125 126 127 128 129 130 131
'isbn10': { method: (val) => V.isISBN(val, 10), message: 'ISBN (version 10) string' }, 'isbn13': { method: (val) => V.isISBN(val, 13), message: 'ISBN (version 13) string' }, // check if the string is an ISSN. (https://en.wikipedia.org/wiki/International_Standard_Serial_Number) 'issn': {
0
0
0
validator.escape is the most popular function in validator (548 examples)