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

V2 - uses precise calculation for node.js, and separate implementation for the browser. #70

Merged
merged 8 commits into from
Jan 24, 2023

Conversation

miktam
Copy link
Owner

@miktam miktam commented Jan 23, 2023

V2 uses different implementations for Node.js and browsers.

Node.js: the Buffer.from(objectToString) method to convert the object's string representation to a buffer, and then it uses the byteLength property to obtain the size of the buffer in bytes.

Browser: Iterates through a tree recursively and, depending on the element type, calculates byte size.

… the string representation of the object to a buffer and then it uses the byteLength property to obtain the size of the buffer in bytes
@miktam miktam self-assigned this Jan 23, 2023
@miktam miktam added this to the v2 milestone Jan 23, 2023
@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@fad2ede). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master      #70   +/-   ##
=========================================
  Coverage          ?   92.68%           
=========================================
  Files             ?        2           
  Lines             ?       41           
  Branches          ?        0           
=========================================
  Hits              ?       38           
  Misses            ?        3           
  Partials          ?        0           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@miktam miktam changed the title V2 - uses the Buffer.from(objectToString). Precise calculation for node.js V2 - uses precise calculation for node.js, and separate implementation for the browser. Jan 24, 2023
@miktam miktam merged commit c8675b6 into master Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants