You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This could be an interesting feature.
Would u consider a PR with the following logic?
IF input length = 10 AND it != starts with 978|979 AND parse = null >> ERROR
ELSE IF input length = 13 AND it starts with 978|979 and parse = null >> ERROR
ELSE IF input length > 13 >> ERROR
ELSE >> null
so error is thrown only when there is formally ISBN-like input but after the parsing there is a null
883951856 (9 digits) >> null
97888 >> null
978883951856 >> null
9788839518569 >> valid
9788839518568 >> error
Maybe such a feature could be a new function, such as parseStrict, or behind a flag: parse(isbn, { strict: true }). In both case, that would remove the problem of the breaking change.
Another idea: it could also (optionally?) enrich the error with the info gathered by the audit function
It would be useful to return an error message with details of why isbn validation failed.
The text was updated successfully, but these errors were encountered: