Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

object-sizeof

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-sizeof - npm Package Compare versions

Comparing version 2.4.1 to 2.4.2

16

indexv2.js

@@ -6,11 +6,2 @@ // Copyright 2023 ChatGPT Jan 9 Version

/** Is Node.js environment */
function isNode () {
return (
typeof process === 'object' &&
typeof process.versions === 'object' &&
typeof process.versions.node !== 'undefined'
)
}
/**

@@ -73,8 +64,3 @@ * Size in bytes for complex objects

} else if (typeof value === 'function') {
if (isNode()) {
const util = require('util')
bytes += Buffer.byteLength(util.inspect(value), 'utf8')
} else {
bytes += value.toString().length
}
bytes += value.toString().length
} else if (typeof value === 'object' && objectList.indexOf(value) === -1) {

@@ -81,0 +67,0 @@ objectList.push(value)

2

package.json
{
"name": "object-sizeof",
"version": "2.4.1",
"version": "2.4.2",
"description": "Sizeof of a JavaScript object in Bytes",

@@ -5,0 +5,0 @@ "main": "indexv2.js",

## object-sizeof
[![Build](https://img.shields.io/npm/v/object-sizeof)](https://img.shields.io/npm/v/object-sizeof) [![Build Status](https://travis-ci.org/miktam/sizeof.svg?branch=master)](https://travis-ci.org/miktam/sizeof) ![GitHub contributors](https://img.shields.io/github/contributors/miktam/sizeof) [![NPM](https://img.shields.io/npm/dy/object-sizeof)](https://img.shields.io/npm/dy/object-sizeof) [![codecov](https://codecov.io/gh/miktam/sizeof/branch/master/graph/badge.svg?token=qPHxmWpC1K)](https://codecov.io/gh/miktam/sizeof)
[![Build](https://img.shields.io/npm/v/object-sizeof)](https://img.shields.io/npm/v/object-sizeof) ![GitHub contributors](https://img.shields.io/github/contributors/miktam/sizeof) [![NPM](https://img.shields.io/npm/dy/object-sizeof)](https://img.shields.io/npm/dy/object-sizeof) [![codecov](https://codecov.io/gh/miktam/sizeof/branch/master/graph/badge.svg?token=qPHxmWpC1K)](https://codecov.io/gh/miktam/sizeof)

@@ -19,3 +19,3 @@ ### Get size of a JavaScript object in Bytes

- Function
### Coding standards

@@ -22,0 +22,0 @@

@@ -95,9 +95,2 @@ 'use strict'

it('Function support', () => {
const func = (one, two) => {
return one + two
}
sizeof(func).should.equal(16)
})
it('nested objects', () => {

@@ -109,14 +102,3 @@ const obj = { a: 1, b: 2, c: 3 }

})
})
describe('sizeof browser tests', function () {
const versions = global.process.versions
before(function () {
delete global.process.versions
})
after(function () {
global.process.versions = versions
})
it('Function support', () => {

@@ -123,0 +105,0 @@ const func = (one, two) => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc