New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

icepick

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

icepick - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

10

icepick.js

@@ -20,5 +20,5 @@ /**

// This will skip objects created with `new Foo()`
// but not objects created with `Object.create(proto)`
// The benefit is ignoring DOM elements, which are often
// circular.
// and objects created with `Object.create(proto)`
// The benefit is ignoring DOM elements and event emitters,
// which are often circular.
isObjectLike(val));

@@ -28,3 +28,5 @@ }

function isObjectLike(val) {
return typeof val === "object" && val.constructor === Object;
return typeof val === "object" &&
val.constructor === Object &&
Object.getPrototypeOf(val) === Object.prototype;
}

@@ -31,0 +33,0 @@

17

icepick.test.js

@@ -527,2 +527,4 @@ /* jshint elision:true */

describe("_weCareAbout", function () {
function Foo() {}
it("should care about objects", function () {

@@ -541,4 +543,17 @@ expect(i._weCareAbout({})).to.equal(true);

it("should not care about undefined", function () {
expect(i._weCareAbout(null)).to.equal(false);
expect(i._weCareAbout(undefined)).to.equal(false);
});
it("should not care about class instances", function () {
expect(i._weCareAbout(new Foo())).to.equal(false);
});
it("should not care about objects created with Object.create()",
function () {
expect(i._weCareAbout(Object.create(Foo.prototype))).to.equal(false);
});
it("should not care about objects created with Object.create({})",
function () {
expect(i._weCareAbout(Object.create({
foo: function () {}
}))).to.equal(false);
});
});

@@ -545,0 +560,0 @@

{
"name": "icepick",
"version": "1.0.0",
"version": "1.1.0",
"description": "Utilities for treating frozen JavaScript objects as persistent immutable collections.",

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

Sorry, the diff of this file is not supported yet

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