
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
the fastest function for deep clone js objects compatible with es6
*according to the author, this cloning script is the fastest in the industry(watch benchmarks)
npm install --save qclone
const qclone = require('qclone');
or connect separate modules:
const qclone = require('qclone/qcloneStrictCircular');
const newCloneObj = qclone({ foo: 1 });
The library contains four cloning functions: qclone, qcloneStrict, qcloneCircular, qcloneStrictCircular.
For more than 90% of cases, the algorithm is suitable - qclone. If you lack it, for example, for cyclic objects or strict copying, you can use the following algorithms:
For more balanced testing of performance, tests of other projects were used
Nodejs - v13.3.0
Date - 22.01.2020
rfdc project test result
benchDeepCopy*100: 7776.478ms
benchLodashCloneDeep*100: 20040.199ms
benchFastCopy*100: 10990.298ms
benchRfdc*100: 4435.846ms
benchQclone*100: 3481.686ms
benchQcloneCircular*100: 5113.696ms
benchQcloneStrict*100: 47226.868ms
benchQcloneStrictCircular*100: 48079.723ms
benchRfdcProto*100: 4354.412ms
benchRfdcCircles*100: 5461.455ms
benchRfdcCirclesProto*100: 5541.977ms
fast-copy project test result
| Name | Ops / sec |
|---|---|
| qclone | 2,069.919 |
| qcloneCircular | 1,092.98 |
| fast-copy | 674.629 |
| lodash.cloneDeep | 323.661 |
| clone | 323.007 |
| ramda | 206.035 |
| deepclone | 175.292 |
| qcloneStrictCircular | 156.258 |
| fast-copy (strict) | 151.173 |
| fast-clone | 125.238 |
| qcloneStrict | 121.703 |
Nodejs - v14.9.0
Date - 01.10.2020
klona project test result
Benchmark :: json
JSON.stringify x 18,355 ops/sec ±0.68% (83 runs sampled)
lodash x 19,501 ops/sec ±0.53% (87 runs sampled)
rfdc x 90,519 ops/sec ±0.57% (88 runs sampled)
clone x 16,963 ops/sec ±0.33% (88 runs sampled)
clone/include x 9,343 ops/sec ±0.70% (90 runs sampled)
clone-deep x 52,055 ops/sec ±0.79% (89 runs sampled)
deep-copy x 51,496 ops/sec ±0.22% (87 runs sampled)
klona/full x 21,732 ops/sec ±0.24% (92 runs sampled)
klona x 114,363 ops/sec ±0.57% (89 runs sampled)
klona/lite x 127,689 ops/sec ±0.57% (88 runs sampled)
klona/json x 136,417 ops/sec ±0.23% (92 runs sampled)
qclone x 141,203 ops/sec ±0.41% (90 runs sampled)
Benchmark :: lite
lodash x 14,211 ops/sec ±0.36% (92 runs sampled)
clone x 14,738 ops/sec ±1.38% (87 runs sampled)
clone/include x 7,970 ops/sec ±0.67% (89 runs sampled)
clone-deep x 41,739 ops/sec ±0.47% (90 runs sampled)
klona/full x 18,371 ops/sec ±0.34% (89 runs sampled)
klona x 89,160 ops/sec ±0.42% (91 runs sampled)
klona/lite x 97,288 ops/sec ±0.65% (90 runs sampled)
qclone x 109,539 ops/sec ±0.27% (90 runs sampled)
*The next two tests below clone the keys for the Map class if those are objects. I do not consider this behavior to be correct, since the work for such keys is based on references and not values (most cloning libraries support my opinion).
Benchmark :: default
lodash x 14,529 ops/sec ±2.64% (82 runs sampled)
clone x 31,979 ops/sec ±0.35% (88 runs sampled)
clone/include x 18,751 ops/sec ±0.50% (87 runs sampled)
klona/full x 30,788 ops/sec ±1.00% (88 runs sampled)
klona x 77,617 ops/sec ±0.34% (91 runs sampled)
qclone x 169,658 ops/sec ±0.59% (90 runs sampled)
Benchmark :: full
lBenchmark :: full
lodash x 15,230 ops/sec ±3.17% (89 runs sampled)
clone/include x 13,651 ops/sec ±0.43% (86 runs sampled)
klona/full x 26,493 ops/sec ±2.05% (92 runs sampled)
qclone(qcloneStrict) x 39,462 ops/sec ±1.05% (90 runs sampled)
MIT Yuriy Khomenko
FAQs
the fastest function for deep clone js objects compatible with es6
The npm package qclone receives a total of 632 weekly downloads. As such, qclone popularity was classified as not popular.
We found that qclone demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.