X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=deep-clone-object.mjs;h=9ed4037324d5507c23f5443021385998346e9d74;hb=ca7662c820c4bd5a4e58570be2859e9860395b68;hp=be98817da7967080ecec8d95b60e1a8edb3be266;hpb=95d31631e49a5a39e261745c31f526691dab5f81;p=benchmarks-js.git diff --git a/deep-clone-object.mjs b/deep-clone-object.mjs index be98817..9ed4037 100644 --- a/deep-clone-object.mjs +++ b/deep-clone-object.mjs @@ -10,19 +10,19 @@ const object = generateRandomObject() Benchmark.suite( `Deep clone object with ${Object.keys(object).length} keys`, Benchmark.add('JSON stringify/parse', (obj = object) => { - const objClone = JSON.parse(JSON.stringify(obj)) + const objCloned = JSON.parse(JSON.stringify(obj)) }), Benchmark.add('structuredClone', (obj = object) => { - const objClone = structuredClone(obj) + const objCloned = structuredClone(obj) }), Benchmark.add('lodash cloneDeep', (obj = object) => { - const objClone = _.cloneDeep(obj) + const objCloned = _.cloneDeep(obj) }), Benchmark.add('just-clone', (obj = object) => { - const objClone = clone(obj) + const objCloned = clone(obj) }), Benchmark.add('deep-clone', (obj = object) => { - const objClone = deepClone(obj) + const objCloned = deepClone(obj) }), Benchmark.cycle(), Benchmark.complete(), @@ -41,6 +41,6 @@ Benchmark.suite( format: 'table.html', details: true }) -).catch(err => { +).catch((err) => { console.error(err) })