Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: miktam/sizeof
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.6.4
Choose a base ref
...
head repository: miktam/sizeof
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 075543eda1b90ac9b333783529273974ecfbf42e
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Jan 21, 2024

  1. Bump @babel/traverse from 7.20.13 to 7.23.2 (#93)

    Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.20.13 to 7.23.2.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)
    
    ---
    updated-dependencies:
    - dependency-name: "@babel/traverse"
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jan 21, 2024
    Copy the full SHA
    3c362de View commit details

Commits on Jul 12, 2024

  1. 2.6.5 release: Include #98"

    miktam committed Jul 12, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    de1dd9e View commit details
  2. Implemented #98, #96

    miktam committed Jul 12, 2024
    Copy the full SHA
    075543e View commit details
Showing with 576 additions and 532 deletions.
  1. +4 −3 indexv2.js
  2. +564 −526 package-lock.json
  3. +3 −3 package.json
  4. +5 −0 test/test.js
7 changes: 4 additions & 3 deletions indexv2.js
Original file line number Diff line number Diff line change
@@ -2,7 +2,8 @@
/* eslint-disable new-cap */ // to fix new Buffer.from
'use strict'
const ECMA_SIZES = require('./byte_size')
const Buffer = require('buffer/').Buffer
const Buffer =
typeof window !== 'undefined' ? require('buffer/').Buffer : global.Buffer

/**
* Precisely calculate size of string in node
@@ -72,8 +73,8 @@ function objectSizeComplex (obj) {

totalSize = Buffer.byteLength(serializedObj, 'utf8')
} catch (ex) {
console.error('Error detected, returning ' + errorIndication, ex)
return errorIndication
// do not log anyting to console.error
return new Error(errorIndication)
}

return totalSize
Loading