Skip to content

Commit f9e8237

Browse files
author
Jerry Bruwes
committed
modified: index.ts
1 parent 8ed4c8d commit f9e8237

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

index.ts

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -68,28 +68,26 @@ export default (
6868
configurable?: boolean;
6969
value?: Record<string, unknown> | undefined;
7070
} = {},
71-
): Record<string, unknown>[] => {
72-
const defineProperties = (
73-
value: Record<string, unknown>,
74-
): Record<string, unknown>[] => {
75-
Object.defineProperties(value, {
76-
...properties,
77-
[keyParent]: parent,
78-
[keySiblings]: siblings,
79-
});
80-
return [
81-
value,
82-
...getLeaves(
83-
{
84-
configurable,
85-
value: (value[keyChildren] ?? []) as Record<string, unknown>[],
86-
},
87-
{ configurable, value },
88-
),
89-
];
90-
};
91-
return siblings.value.flatMap(defineProperties);
92-
};
71+
): Record<string, unknown>[] =>
72+
siblings.value.flatMap(
73+
(value: Record<string, unknown>): Record<string, unknown>[] => {
74+
Object.defineProperties(value, {
75+
...properties,
76+
[keyParent]: parent,
77+
[keySiblings]: siblings,
78+
});
79+
return [
80+
value,
81+
...getLeaves(
82+
{
83+
configurable,
84+
value: (value[keyChildren] ?? []) as Record<string, unknown>[],
85+
},
86+
{ configurable, value },
87+
),
88+
];
89+
},
90+
);
9391

9492
/* -------------------------------------------------------------------------- */
9593
/* Reactives */

0 commit comments

Comments
 (0)