Skip to content

Commit 9846ea7

Browse files
committed
modified: src/index.ts
1 parent 87f462c commit 9846ea7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ export default (
8080
add: (pId: string) => {
8181
const the = objLeaves[pId];
8282
if (the) {
83-
const children = the[keyChildren] as
84-
| Record<string, unknown>[]
85-
| undefined,
83+
const url = URL.createObjectURL(new Blob()),
84+
[id] = url.toString().split("/").reverse(),
85+
children = the[keyChildren] as Record<string, unknown>[] | undefined,
8686
index = the[keyIndex] as number,
8787
siblings = the[keySiblings] as Record<string, unknown>[];
88-
const id = Math.random().toString(36).slice(2);
88+
URL.revokeObjectURL(url);
8989
switch (true) {
9090
case !!the[keyParent]:
9191
siblings.splice(index + 1, 0, { [keyId]: id });

0 commit comments

Comments
 (0)