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%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
145,920
Last Day
5
Last Week
9
Last Month
38
Last Year
1,564
1 Stars
35 Commits
2 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
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
400%
5
Compared to previous day
Last week
80%
9
Compared to previous week
Last month
40.7%
38
Compared to previous month
Last year
-20.8%
1,564
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
Found 1/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
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-02-03
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