X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=shallow-clone-object.js;h=f8e193b65e701a7d91294cfa6bf973cd7d6b696d;hb=cd73a6879a4bb57eebf1a9127c9369fce0797fc9;hp=18c396dc4d72f9e348e3be108be4a44b3d4c52ea;hpb=5b907dbf7ed955584eb9f452f9dc4c8f59577816;p=benchmarks-js.git diff --git a/shallow-clone-object.js b/shallow-clone-object.js index 18c396d..f8e193b 100644 --- a/shallow-clone-object.js +++ b/shallow-clone-object.js @@ -1,12 +1,12 @@ /* eslint-disable no-unused-vars */ const Benchmark = require('benny') -const { generateRandomObject } = require('./benchmark-utils') const _ = require('lodash') +const { generateRandomObject } = require('./benchmark-utils') -const { object, size } = generateRandomObject() +const object = generateRandomObject() Benchmark.suite( - `Shallow clone object with ${size} keys`, + `Shallow clone object with ${Object.keys(object).length} keys`, Benchmark.add('Spread', (obj = object) => { const objClone = { ...obj } }), @@ -33,4 +33,6 @@ Benchmark.suite( format: 'table.html', details: true }) -) +).catch(err => { + console.error(err) +})