switch to ESM
[benchmarks-js.git] / deep-clone-object.mjs
similarity index 77%
rename from deep-clone-object.js
rename to deep-clone-object.mjs
index 0f480c424263664a2e02ab3d8663a9bb87c65bf6..52a1bac29a382a19d6a9c2a060400797d2795a04 100644 (file)
@@ -1,8 +1,9 @@
 /* eslint-disable no-unused-vars */
-const Benchmark = require('benny')
-const _ = require('lodash')
-const clone = require('just-clone')
-const { generateRandomObject } = require('./benchmark-utils')
+import Benchmark from 'benny'
+import _ from 'lodash'
+import clone from 'just-clone'
+import deepClone from 'deep-clone'
+import { generateRandomObject } from './benchmark-utils.js'
 
 const object = generateRandomObject()
 
@@ -20,6 +21,9 @@ Benchmark.suite(
   Benchmark.add('just-clone', (obj = object) => {
     const objClone = clone(obj)
   }),
+  Benchmark.add('deep-clone', (obj = object) => {
+    const objClone = deepClone(obj)
+  }),
   Benchmark.cycle(),
   Benchmark.complete(),
   Benchmark.save({