Skip to content

feat: Added ability to enforce numeric map keys are encoded as numbers rather than strings#4

Closed
robdmoore wants to merge 1 commit into
algorand:mainfrom
robdmoore:numeric-map-keys
Closed

feat: Added ability to enforce numeric map keys are encoded as numbers rather than strings#4
robdmoore wants to merge 1 commit into
algorand:mainfrom
robdmoore:numeric-map-keys

Conversation

@robdmoore
Copy link
Copy Markdown

No description provided.

Comment thread README.md Outdated
sortKeys | boolean | false
forceFloat32 | boolean | false
forceIntegerToFloat | boolean | false
forceNumericMapKeys | boolean | false
Copy link
Copy Markdown
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

Comment thread src/Encoder.ts
if (typeof key === "string") {
this.encodeString(key);
} else {
this.encodeNumber(key);
Copy link
Copy Markdown
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
Copy Markdown

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