fix: remove nodeLinker=hoisted, replace transitive imports with existing deps

This commit is contained in:
Thomas Camlong committed 2026-06-27 23:32:30 +02:00
1 parent db3d58821e
commit f2d6563273
3 files changed
+16 -10

No files matched your search

+14 -3
View File
@@ -1,5 +1,3 @@
import { hashKey } from "@tanstack/query-core";
export function objectKeys<O extends object>(obj: O): (keyof O)[] {
return Object.keys(obj) as (keyof O)[];
}
@@ -11,5 +9,18 @@ type Entries<T> = {
export const objectEntries = <T extends object>(obj: T) => Object.entries(obj) as Entries<T>;
export const hashObjectBase64 = (obj: object) => {
return Buffer.from(hashKey([obj])).toString("base64");
const json = JSON.stringify([obj], (_, val) =>
typeof val === "object" && val !== null && !Array.isArray(val)
? Object.keys(val)
.sort()
.reduce(
(acc, key) => {
acc[key] = (val as Record<string, unknown>)[key];
return acc;
},
{} as Record<string, unknown>,
)
: val,
);
return Buffer.from(json).toString("base64");
};