Skip to content

Commit 3d0d0c5

Browse files
author
Jerry Bruwes
committed
modified: index.ts
1 parent 4411213 commit 3d0d0c5

File tree

1 file changed

+13
-25
lines changed

1 file changed

+13
-25
lines changed

index.ts

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
1-
/* -------------------------------------------------------------------------- */
2-
/* Imports */
3-
/* -------------------------------------------------------------------------- */
4-
51
import type { ComputedRef, Reactive } from "vue";
62

73
import { v4 } from "uuid";
84
import { computed, isReactive, reactive } from "vue";
95

10-
/* -------------------------------------------------------------------------- */
11-
/* Constants */
12-
/* -------------------------------------------------------------------------- */
13-
14-
const configurable = true;
15-
16-
/* -------------------------------------------------------------------------- */
17-
/* Functions */
18-
/* -------------------------------------------------------------------------- */
19-
20-
function useFlatJsonTree(
6+
export default (
217
tree: Reactive<Record<string, unknown>[]> | Record<string, unknown>[],
228
{
239
branch: keyBranch = "branch",
@@ -46,7 +32,13 @@ function useFlatJsonTree(
4632
remove: (pId: string) => null | string;
4733
right: (pId: string) => null | string;
4834
up: (pId: string) => void;
49-
} {
35+
} => {
36+
/* -------------------------------------------------------------------------- */
37+
/* Constants */
38+
/* -------------------------------------------------------------------------- */
39+
40+
const configurable = true;
41+
5042
/* -------------------------------------------------------------------------- */
5143
/* Objects */
5244
/* -------------------------------------------------------------------------- */
@@ -118,7 +110,7 @@ function useFlatJsonTree(
118110
}
119111

120112
/* -------------------------------------------------------------------------- */
121-
/* Constants */
113+
/* Reactives */
122114
/* -------------------------------------------------------------------------- */
123115

124116
const value: Reactive<Record<string, unknown>[]> = isReactive(tree)
@@ -288,15 +280,11 @@ function useFlatJsonTree(
288280
}
289281
}
290282

283+
/* -------------------------------------------------------------------------- */
284+
/* Main */
291285
/* -------------------------------------------------------------------------- */
292286

293287
return { add, down, leaves, left, remove, right, up };
294-
}
295288

296-
/* -------------------------------------------------------------------------- */
297-
/* Exports */
298-
/* -------------------------------------------------------------------------- */
299-
300-
export default useFlatJsonTree;
301-
302-
/* -------------------------------------------------------------------------- */
289+
/* -------------------------------------------------------------------------- */
290+
};

0 commit comments

Comments
 (0)