-
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
Feat/hybrid #13
Feat/hybrid #13
Conversation
tsconfig.json
Outdated
"extends": "./tsconfig.base.json", | ||
"compilerOptions": { | ||
"outDir": "src/esm", | ||
"esModuleInterop": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
esModuleInterop is only useful for commonjs
ESM does not need interop considerations with ESM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right..., will move it
tsconfig.base.json
Outdated
"module": "commonjs", | ||
"outDir": "./src", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
module and outDir are both defined in the other configs. Not really needed.
Can you write a benchmark that compares all these DataView and ArrayBuffers to something simpler? I think we should add some bit writing functions in uint8array-tool and use those. But if DataView and ArrayBuffer are fast enough it might be fine. |
src/esm/index.js
Outdated
bytes: 5 | ||
}; | ||
// 64 bit | ||
} | ||
else { | ||
const number = tools.readUInt64(buffer, offset + 1, 'LE'); | ||
return { value: number, bytes: 9 }; | ||
return { numberValue: null, bigintValue: number, bytes: 9 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if number is <=
to Number.MAX_SAFE_INTEGER
then return the numberValue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 95ff37a
This PR: