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: Added ability to enforce numeric map keys are encoded as numbers rather than strings #4

Closed
wants to merge 1 commit into from

Conversation

robdmoore
Copy link

No description provided.

README.md Outdated
@@ -119,6 +119,7 @@ initialBufferSize | number | `2048`
sortKeys | boolean | false
forceFloat32 | boolean | false
forceIntegerToFloat | boolean | false
forceNumericMapKeys | boolean | false
Copy link
Author

Choose a reason for hiding this comment

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

This will definitely conflict with the other PRs

if (typeof key === "string") {
this.encodeString(key);
} else {
this.encodeNumber(key);
Copy link
Author

Choose a reason for hiding this comment

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

This will automatically encode as an appropriate number (admittedly, based on int mode when that PR lands) so there isn't a lot of control over the type - potentially we want that to be configurable e.g. to always set them to uint64 or similar?

@jasonpaulos
Copy link

Closing in favor of #5

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