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

@sinonjs/samsam

Package Overview
Dependencies
Maintainers
5
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sinonjs/samsam - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

58

dist/samsam.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('array-from')) :
typeof define === 'function' && define.amd ? define(['exports', 'array-from'], factory) :
(factory((global.samsam = {}),global.arrayFrom));
}(this, (function (exports,arrayFrom) { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.samsam = {})));
}(this, (function (exports) { 'use strict';
arrayFrom = arrayFrom && arrayFrom.hasOwnProperty('default') ? arrayFrom['default'] : arrayFrom;
var o = Object.prototype;

@@ -157,25 +155,14 @@

function isSubset(s1, s2, compare) {
// FIXME: IE11 doesn't support Array.from
// Potential solutions:
// - contribute a patch to https://github.com/Volox/eslint-plugin-ie11#readme
// - https://github.com/mathiasbynens/Array.from (doesn't work with matchers)
var values1 = arrayFrom(s1);
var values2 = arrayFrom(s2);
for (var i = 0; i < values1.length; i++) {
var allContained = true;
s1.forEach(function(v1) {
var includes = false;
for (var j = 0; j < values2.length; j++) {
if (compare(values2[j], values1[i])) {
s2.forEach(function(v2) {
if (compare(v2, v1)) {
includes = true;
break;
}
}
});
allContained = allContained && includes;
});
if (!includes) {
return false;
}
}
return true;
return allContained;
}

@@ -185,4 +172,17 @@

var re = /function (\w+)\s*\(/;
function getClassName(value) {
return value.constructor ? value.constructor.name : null;
if (value.constructor && "name" in value.constructor) {
return value.constructor.name;
}
if (typeof value.constructor === "function") {
var match = value.constructor.toString().match(re);
if (match.length > 1) {
return match[1];
}
}
return null;
}

@@ -269,3 +269,7 @@

if (obj1 instanceof Error && obj2 instanceof Error) {
if (obj1.stack !== obj2.stack) {
if (
obj1.constructor !== obj2.constructor ||
obj1.message !== obj2.message ||
obj1.stack !== obj2.stack
) {
return false;

@@ -272,0 +276,0 @@ }

@@ -91,3 +91,7 @@ "use strict";

if (obj1 instanceof Error && obj2 instanceof Error) {
if (obj1.stack !== obj2.stack) {
if (
obj1.constructor !== obj2.constructor ||
obj1.message !== obj2.message ||
obj1.stack !== obj2.stack
) {
return false;

@@ -94,0 +98,0 @@ }

"use strict";
var re = /function (\w+)\s*\(/;
function getClassName(value) {
return value.constructor ? value.constructor.name : null;
if (value.constructor && "name" in value.constructor) {
return value.constructor.name;
}
if (typeof value.constructor === "function") {
var match = value.constructor.toString().match(re);
if (match.length > 1) {
return match[1];
}
}
return null;
}
module.exports = getClassName;
"use strict";
var from = require("array-from");
function isSubset(s1, s2, compare) {
// FIXME: IE11 doesn't support Array.from
// Potential solutions:
// - contribute a patch to https://github.com/Volox/eslint-plugin-ie11#readme
// - https://github.com/mathiasbynens/Array.from (doesn't work with matchers)
var values1 = from(s1);
var values2 = from(s2);
for (var i = 0; i < values1.length; i++) {
var allContained = true;
s1.forEach(function(v1) {
var includes = false;
for (var j = 0; j < values2.length; j++) {
if (compare(values2[j], values1[i])) {
s2.forEach(function(v2) {
if (compare(v2, v1)) {
includes = true;
break;
}
}
});
allContained = allContained && includes;
});
if (!includes) {
return false;
}
}
return true;
return allContained;
}
module.exports = isSubset;
{
"name": "@sinonjs/samsam",
"version": "2.1.1",
"version": "2.1.2",
"description": "Value identification and comparison functions",

@@ -24,3 +24,5 @@ "homepage": "http://sinonjs.github.io/samsam/",

"test": "mocha ./lib/*.test.js",
"test-coverage": "nyc --reporter text --reporter html --reporter lcovonly npm run test"
"test-cloud": "npm run test-headless -- --wd",
"test-coverage": "nyc --reporter text --reporter html --reporter lcovonly npm run test",
"test-headless": "mochify lib/*.test.js"
},

@@ -33,5 +35,3 @@ "files": [

],
"dependencies": {
"array-from": "^2.1.1"
},
"dependencies": {},
"devDependencies": {

@@ -53,2 +53,3 @@ "@sinonjs/referee": "^2.0.0",

"mocha": "^5.0.0",
"mochify": "^5.8.1",
"npm-run-all": "^4.1.2",

@@ -55,0 +56,0 @@ "nyc": "^11.7.3",

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