refactor: switch to using Bun (#718)

This commit is contained in:
Dan Ditomaso
2025-07-16 22:30:10 -04:00
committed by GitHub
parent acfd7ebd2d
commit 704d06cfe7
401 changed files with 35294 additions and 39107 deletions
+3 -6
View File
@@ -1,19 +1,16 @@
export type DotPath = { [key: string]: unknown } | unknown[];
export const dotPaths = <T extends DotPath>(
obj: T,
prefix = "",
): string[] => {
export const dotPaths = <T extends DotPath>(obj: T, prefix = ""): string[] => {
if (Array.isArray(obj)) {
return obj.flatMap((v, i) =>
v && typeof v === "object"
? dotPaths(v as DotPath, `${prefix}${i}.`)
: [`${prefix}${i}`]
: [`${prefix}${i}`],
);
}
return Object.entries(obj).flatMap(([k, v]) =>
v && typeof v === "object"
? dotPaths(v as DotPath, `${prefix}${k}.`)
: [`${prefix}${k}`]
: [`${prefix}${k}`],
);
};