mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
18 lines
502 B
TypeScript
18 lines
502 B
TypeScript
import { TraceType } from "@refinedev/devtools-shared";
|
|
import { MutationKey, QueryKey } from "@tanstack/react-query";
|
|
|
|
export const createIdentifier = (
|
|
key?: QueryKey | MutationKey,
|
|
trace?: TraceType[],
|
|
) => {
|
|
const simpleTrace = trace?.map(
|
|
(t) =>
|
|
`${t.file}:${t.line}:${t.column}#${t.function}-${t.packageName}-${
|
|
t.isRefine ? 1 : 0
|
|
}`,
|
|
);
|
|
const str = JSON.stringify([...(key ?? []), ...(simpleTrace ?? [])]);
|
|
|
|
return str;
|
|
};
|