Skip to content

Commit 2311ec3

Browse files
committed
Replace dependency
1 parent 2e3ff5b commit 2311ec3

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/contents.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* `hast-util-sanitize`.
2222
*/
2323

24-
import extend from 'extend'
24+
import structuredClone from '@ungap/structured-clone'
2525

2626
/**
2727
* Transform a list of heading objects to a markdown list.
@@ -168,9 +168,11 @@ function one(node) {
168168

169169
if ('children' in node) {
170170
const {children, position, ...copy} = node
171-
return Object.assign(extend(true, {}, copy), {children: all(node.children)})
171+
return Object.assign(structuredClone(copy), {
172+
children: all(node.children)
173+
})
172174
}
173175

174176
const {position, ...copy} = node
175-
return extend(true, {}, copy)
177+
return structuredClone(copy)
176178
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
"index.js"
3636
],
3737
"dependencies": {
38-
"@types/extend": "^3.0.0",
3938
"@types/mdast": "^4.0.0",
40-
"extend": "^3.0.0",
39+
"@ungap/structured-clone": "^1.0.0",
40+
"@types/ungap__structured-clone": "^0.3.0",
4141
"github-slugger": "^2.0.0",
4242
"mdast-util-to-string": "^4.0.0",
4343
"unist-util-is": "^6.0.0",

0 commit comments

Comments
 (0)