-
Notifications
You must be signed in to change notification settings - Fork 7
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
Incorrect handling of arrays with gaps #12
Comments
Hi @KapitanOczywisty, the library isn't intended to handle gaps because they're not part of JSON specification. |
@daniel-zahariev Beside producing invalid code without any exception, such arrays are correctly handled by JSON.stringify([1,,,2]); // '[1,null,null,2]' |
@KapitanOczywisty, |
I know it's invalid, but You're providing JS object not JSON string as function argument. And yes, I've already produced my own implementation, since I cannot afford script which results in invalid PHP without any warning and doesn't have any fail-safe for circular references. |
Function cannot handle gaps in arrays
Results in:
https://3v4l.org/KKbIJ
Best would be treat arrays like objects.
The text was updated successfully, but these errors were encountered: