Socket
Socket
Sign inDemoInstall

samsam

Package Overview
Dependencies
Maintainers
3
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

samsam - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

.project

8

lib/samsam.js

@@ -32,2 +32,3 @@ ((typeof define === "function" && define.amd && function (m) { define("samsam", m); }) ||

function isArguments(object) {
if (getClass(object) === 'Arguments') { return true; }
if (typeof object !== "object" || typeof object.length !== "number" ||

@@ -358,3 +359,8 @@ getClass(object) === "Array") {

for (prop in matcher) {
if (!match(object[prop], matcher[prop])) {
var value = object[prop];
if (typeof value === "undefined" &&
typeof object.getAttribute === "function") {
value = object.getAttribute(prop);
}
if (typeof value === "undefined" || !match(value, matcher[prop])) {
return false;

@@ -361,0 +367,0 @@ }

5

package.json
{
"name": "samsam",
"version": "1.1.0",
"version": "1.1.1",
"description": "Value identification and comparison functions",

@@ -26,3 +26,4 @@ "homepage": "http://busterjs.org/docs/buster-assertions",

"scripts": {
"test": "node test/samsam-test.js"
"test": "node test/samsam-test.js",
"test-debug": "node --debug-brk test/samsam-test.js"
},

@@ -29,0 +30,0 @@ "devDependencies": {

@@ -7,2 +7,5 @@ if (typeof module === "object" && typeof require === "function") {

(function () {
var assert = buster.assert;
function tests(method, body) {

@@ -343,4 +346,26 @@ var tc = {};

pass("objects with empty arrays", { xs: [] }, { xs: [] });
fail("nested objects with different depth", { a: 1 }, { b: { c: 2 } });
pass("dom elements with matching data attributes", {
getAttribute: function (name) {
if (name === "data-path") {
return "foo.bar";
}
}
}, { "data-path": "foo.bar" });
fail("dom elements with not matching data attributes", {
getAttribute: function (name) {
if (name === "data-path") {
return "foo.foo";
}
}
}, { "data-path": "foo.bar" });
});
tests("isArguments", function (pass, fail) {
pass("arguments object", arguments);
fail("primitive", 42);
fail("object", {});
pass("arguments object from strict-mode function",
(function () { "use strict"; return arguments; }()));
});
}());
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