Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ascii): implement f() to validate string as number according to JSON specification #31

Merged
merged 3 commits into from
Apr 5, 2024

Conversation

Duologic
Copy link
Member

@Duologic Duologic commented Apr 4, 2024

Besides checking whether the characters are all digits, ascii.isStringJSONNumeric can also deal with negative numbers, fractions and exponents.

I've implemented this according to https://www.json.org/json-en.html, I found the notation on https://www.crockford.com/mckeeman.html easier to read.

@Duologic
Copy link
Member Author

Duologic commented Apr 4, 2024

cc/ @replay as you implemented the original function in #28

Copy link
Contributor

@julienduchesne julienduchesne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be a new function? IsStringJSONNumber or something. This modifies the current functionality and the behavior being implemented here would me unexpected to me, considering the function name.

@Duologic Duologic changed the title fix(ascii): implement isStringNumeric according to JSON specification feat(ascii): implement to validate string as number according to JSON specification Apr 4, 2024
@Duologic Duologic changed the title feat(ascii): implement to validate string as number according to JSON specification feat(ascii): implement f() to validate string as number according to JSON specification Apr 5, 2024
@Duologic Duologic merged commit 63d430b into master Apr 5, 2024
2 checks passed
@Duologic Duologic deleted the duologic/jsonnumber branch April 5, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants