feat: add ISBN-10 and ISBN-13 detection#40
Merged
melihbirim merged 1 commit intomainfrom Dec 27, 2025
Merged
Conversation
Add support for detecting ISBN (International Standard Book Number) formats: - Supports ISBN-10 and ISBN-13 - Handles formats with or without hyphens - Handles X checksum in ISBN-10 - Prevents ISBN-like digit sequences from being detected as numbers Changes: - Added ISBN constant to DataTypes - Added ISBN pattern to PATTERNS - Added isISBN() function - Added ISBN to TYPE_PRIORITY, JSON_SCHEMA_TYPE_MAP, and JSON_SCHEMA_PATTERN_MAP - Added comprehensive ISBN tests (5 test cases) - Updated TypeScript definitions - Updated README with ISBN examples Co-authored-by: riazation42 <mkhanriaz42@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for detecting ISBN (International Standard Book Number) in both ISBN-10 and ISBN-13 formats.
Changes
✅ ISBN Detection
ISBNconstant toDataTypesisISBN()function with JSDocTYPE_PRIORITY(after UUID for specificity)JSON_SCHEMA_TYPE_MAPandJSON_SCHEMA_PATTERN_MAP✅ Smart Number Detection
✅ Test Coverage
978-0-596-52068-70-596-52068-99780596520687,0596520689043942089X,155860832X✅ Documentation & Types
index.d.tsValidation
npm run lintcleanAttribution
Feature implementation based on work by @riazation42 from PR #35, cleaned up to add ISBN alongside existing types without removing SEMVER.
Closes #14