Gathering detailed insights and metrics for shallow-equal-jit
Gathering detailed insights and metrics for shallow-equal-jit
Gathering detailed insights and metrics for shallow-equal-jit
Gathering detailed insights and metrics for shallow-equal-jit
Fast object shallow equal using Just-In-Time compiled functions.
npm install shallow-equal-jit
Typescript
Module System
Min. Node Version
65.8
Supply Chain
89.4
Quality
75.1
Maintenance
100
Vulnerability
100
License
TypeScript (65.45%)
JavaScript (34.55%)
Total Downloads
1,415
Last Day
2
Last Week
2
Last Month
18
Last Year
391
MIT License
2 Stars
7 Commits
1 Watchers
17 Branches
1 Contributors
Updated on Jul 10, 2024
Minified
Minified + Gzipped
Latest Version
1.2.0
Package Id
shallow-equal-jit@1.2.0
Unpacked Size
13.11 kB
Size
4.13 kB
File Count
13
Cumulative downloads
Total Downloads
Last Day
100%
2
Compared to previous day
Last Week
-50%
2
Compared to previous week
Last Month
20%
18
Compared to previous month
Last Year
21.8%
391
Compared to previous year
4
Fast shallow equal with Just-In-Time compiled compare functions.
1npm install shallow-equal-jit --save 2# or 3yarn add shallow-equal-jit
1import { shallowEqualJIT } from 'shallow-equal-jit'; 2 3// generate equal function 4const shallowEqual = shallowEqualJIT(['a', 'b']); 5 6console.log(shallowEqual({ a: 1, b: 2 }, { a: 1, b: 2 })); // true 7// keys except for a and b are ignored 8console.log(shallowEqual({ a: 1, b: 2 }, { a: 1, b: 2, c: 3 })); // true 9 10console.log(shallowEqual({ a: 1, b: 2 }, { a: 1, b: 3 })); // false
By default, this library uses Object.is
for comparison, you can pass a second argument as true
to use ===
operator.
1const shallowEqualUsingStrictEq = shallowEqualJIT(['a', 'b'], true);
The following results were produced under Node v12.16.3 on a MacBook Pro (Early 2015) 2.7 GHz Intel Core i5.
shallowequal (object, equal) x 3,273,287 ops/sec ±1.30% (91 runs sampled)
shallowequal (object, same) x 831,562,263 ops/sec ±1.91% (87 runs sampled)
shallowequal (object, unequal) x 5,090,021 ops/sec ±0.88% (84 runs sampled)
is-equal-shallow (object, equal) x 4,010,229 ops/sec ±0.36% (89 runs sampled)
is-equal-shallow (object, same) x 12,001,915 ops/sec ±0.47% (87 runs sampled)
is-equal-shallow (object, unequal) x 7,006,307 ops/sec ±0.27% (91 runs sampled)
shallow-equals (object, equal) x 7,306,243 ops/sec ±1.32% (91 runs sampled)
shallow-equals (object, same) x 21,384,443 ops/sec ±0.18% (91 runs sampled)
shallow-equals (object, unequal) x 12,936,562 ops/sec ±1.07% (90 runs sampled)
fbjs/lib/shallowEqual (object, equal) x 3,025,569 ops/sec ±0.18% (93 runs sampled)
fbjs/lib/shallowEqual (object, same) x 826,443,739 ops/sec ±1.03% (88 runs sampled)
fbjs/lib/shallowEqual (object, unequal) x 4,535,318 ops/sec ±0.19% (90 runs sampled)
fast-equals.shallowEqual (object, equal) x 3,080,743 ops/sec ±0.22% (91 runs sampled)
fast-equals.shallowEqual (object, same) x 830,713,756 ops/sec ±0.91% (90 runs sampled)
fast-equals.shallowEqual (object, unequal) x 4,740,245 ops/sec ±0.98% (91 runs sampled)
fast-shallow-equal (object, equal) x 3,129,008 ops/sec ±0.42% (88 runs sampled)
fast-shallow-equal (object, same) x 841,791,886 ops/sec ±0.83% (89 runs sampled)
fast-shallow-equal (object, unequal) x 4,513,256 ops/sec ±0.39% (93 runs sampled)
@wordpress/is-shallow-equal (object, equal) x 4,353,487 ops/sec ±0.37% (91 runs sampled)
@wordpress/is-shallow-equal (object, same) x 206,089,794 ops/sec ±0.28% (90 runs sampled)
@wordpress/is-shallow-equal (object, unequal) x 6,674,242 ops/sec ±0.31% (88 runs sampled)
shallow-equal-jit (object, equal) x 836,387,131 ops/sec ±0.83% (89 runs sampled)
shallow-equal-jit (object, same) x 836,515,680 ops/sec ±0.94% (89 runs sampled)
shallow-equal-jit (object, unequal) x 828,178,623 ops/sec ±1.03% (87 runs sampled)
shallow-equal-jit (===) (object, equal) x 832,237,483 ops/sec ±1.08% (87 runs sampled)
shallow-equal-jit (===) (object, same) x 838,105,210 ops/sec ±0.96% (88 runs sampled)
shallow-equal-jit (===) (object, unequal) x 843,725,200 ops/sec ±0.76% (91 runs sampled)
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Found 0/7 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no SAST tool detected
Details
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
branch protection not enabled on development/release branches
Details
Reason
44 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
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