repositories
/
benchmarks-js.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update volta pnpm version
[benchmarks-js.git]
/
shallow-clone-object.js
diff --git
a/shallow-clone-object.js
b/shallow-clone-object.js
index 18c396dc4d72f9e348e3be108be4a44b3d4c52ea..f8e193b65e701a7d91294cfa6bf973cd7d6b696d 100644
(file)
--- a/
shallow-clone-object.js
+++ b/
shallow-clone-object.js
@@
-1,12
+1,12
@@
/* eslint-disable no-unused-vars */
const Benchmark = require('benny')
/* eslint-disable no-unused-vars */
const Benchmark = require('benny')
-const { generateRandomObject } = require('./benchmark-utils')
const _ = require('lodash')
const _ = require('lodash')
+const { generateRandomObject } = require('./benchmark-utils')
-const
{ object, size }
= generateRandomObject()
+const
object
= generateRandomObject()
Benchmark.suite(
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 }
}),
Benchmark.add('Spread', (obj = object) => {
const objClone = { ...obj }
}),
@@
-33,4
+33,6
@@
Benchmark.suite(
format: 'table.html',
details: true
})
format: 'table.html',
details: true
})
-)
+).catch(err => {
+ console.error(err)
+})