Gathering detailed insights and metrics for chai-shallow-deep-almost-equal
Gathering detailed insights and metrics for chai-shallow-deep-almost-equal
Gathering detailed insights and metrics for chai-shallow-deep-almost-equal
Gathering detailed insights and metrics for chai-shallow-deep-almost-equal
npm install chai-shallow-deep-almost-equal
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
1 Stars
35 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Oct 02, 2016
Latest Version
1.3.0
Package Id
chai-shallow-deep-almost-equal@1.3.0
Size
3.44 kB
NPM Version
2.13.2
Node Version
2.5.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
It's a fork of https://github.com/michelsalib/chai-shallow-deep-equal which adds .001 float treshold almost-equality feature.
Will shallowly perform a deep almost equal assertion. In other terms is consist of checking that an object, or objects graph, is contained within another one (see examples bellow).
1<script src="chai.js"></script> 2<script src="chai-shallow-deep-almost-equal.js"></script>
1var chai = require('chai'); 2chai.use(require('chai-shallow-deep-almost-equal'));
ShallowDeepAlmostEqual is available for all chai assertion styles:
1var a = {x: 10, y: 10}; 2var b = {x: 10.001}; 3 4a.should.ShallowDeepAlmostEqual(b); 5expect(a).to.ShallowDeepAlmostEqual(b); 6assert.ShallowDeepAlmostEqual(a, b);
1assert.ShallowDeepAlmostEqual({x: 10, y: 10}, {x: 10.001}); // true 2assert.ShallowDeepAlmostEqual({x: 10, y: 10}, {x: 9.999}); // true 3// assert.ShallowDeepAlmostEqual({x: 10, y: 10}, {x: 9.9}); // fails 4 5// the rest are the original shallowDeepEqualTests 6assert.ShallowDeepAlmostEqual({ 7 name: 'Michel', 8 language: 'javascript', 9 tags: [ 10 'developer', 11 'gamer' 12 ]}, 13 { 14 name: 'Michel', 15 tags: [ 16 'developer' 17 ]}); // true 18 19assert.ShallowDeepAlmostEqual([ 20 {brand: 'apple', color: 'red'}, 21 {brand: 'samsung', color: 'blue'}, 22 ], 23 { 24 length: 2, 25 0: {color: 'red'}, 26 1: {brand: 'samsung'}, 27 }); // true 28 29assert.ShallowDeepAlmostEqual({ 30 name: 'Michel', 31 age: undefined 32 }, 33 { 34 name: 'Michel', 35 age: 37 36 }); // false (age should not be defined)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More