Socket
Socket
Sign inDemoInstall

should-equal

Package Overview
Dependencies
1
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.8.0 to 1.0.0

cjs/should-equal.js

25

package.json
{
"name": "should-equal",
"version": "0.8.0",
"version": "1.0.0",
"description": "Deep comparison of 2 instances for should.js",
"main": "index.js",
"main": "cjs/should-equal.js",
"jsnext:main": "es6/should-equal.js",
"scripts": {
"test": "mocha --ui bdd -R mocha-better-spec-reporter test.js"
"test": "mocha --ui bdd -R mocha-better-spec-reporter test.js",
"cjs": "rollup --format=cjs --output=cjs/should-equal.js index.js",
"es6": "rollup --format=es6 --output=es6/should-equal.js index.js",
"build": "npm run cjs && npm run es6",
"prepublish": "npm run build",
"pretest": "npm run build"
},

@@ -27,7 +33,14 @@ "repository": {

"mocha": "latest",
"mocha-better-spec-reporter": "latest"
"mocha-better-spec-reporter": "latest",
"rollup": "^0.26.3"
},
"dependencies": {
"should-type": "0.2.0"
}
"should-type": "^1.0.0"
},
"files": [
"cjs/*",
"es6/*",
"README.md",
"LICENSE"
]
}

@@ -6,16 +6,20 @@ equal

Deep equality comparison implementation for should.js
Deep equality comparison implementation for should.js. **Not supported outside of should.js**
Function return an object that have result of comparison and description of fail:
Function returns an array of failed equality checks if array is empty it means objects are equal:
```js
> var eq = require('.');
undefined
> var a = {a:1,b:2,c:3,d:4,e:5,f:6,g:7,h:8,i:9,j:10},
... b = {a:1,b:2,c:3,d:4,e:5,f:6,g:7,h:7,i:9,j:10};
undefined
> eql(a, b);
{ result: false,
path: [ 'h' ],
reason: 'A and B are not equal',
a: 8,
b: 7 }
> eq(a, b)
[ EqualityFail {
a: 8,
b: 7,
reason: 'A is not equal to B',
path: [ 'h' ],
showReason: false } ]
>
```
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc