Skip to content

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 requested a review from julienduchesne April 4, 2024 21:03
@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
@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.

3 participants