Skip to content

Commit

Permalink
refactor: remove use of Node.js v8 builtin
Browse files Browse the repository at this point in the history
Refs: #442
Refs: #475
Refs: #555
  • Loading branch information
panva committed Feb 2, 2023
1 parent 7bd3e8d commit f1881bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 1 addition & 3 deletions lib/helpers/deep_clone.js
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
const { serialize, deserialize } = require('v8');

module.exports = globalThis.structuredClone || ((obj) => deserialize(serialize(obj)));
module.exports = globalThis.structuredClone || JSON.parse(JSON.stringify(obj));
5 changes: 1 addition & 4 deletions lib/helpers/keystore.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
const v8 = require('v8');

const jose = require('jose');

const clone = globalThis.structuredClone || ((value) => v8.deserialize(v8.serialize(value)));

const clone = require('./deep_clone');
const isPlainObject = require('./is_plain_object');
const isKeyObject = require('./is_key_object');

Expand Down

0 comments on commit f1881bc

Please sign in to comment.