We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87f462c commit 9846ea7Copy full SHA for 9846ea7
src/index.ts
@@ -80,12 +80,12 @@ export default (
80
add: (pId: string) => {
81
const the = objLeaves[pId];
82
if (the) {
83
- const children = the[keyChildren] as
84
- | Record<string, unknown>[]
85
- | undefined,
+ const url = URL.createObjectURL(new Blob()),
+ [id] = url.toString().split("/").reverse(),
+ children = the[keyChildren] as Record<string, unknown>[] | undefined,
86
index = the[keyIndex] as number,
87
siblings = the[keySiblings] as Record<string, unknown>[];
88
- const id = Math.random().toString(36).slice(2);
+ URL.revokeObjectURL(url);
89
switch (true) {
90
case !!the[keyParent]:
91
siblings.splice(index + 1, 0, { [keyId]: id });
0 commit comments