mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 09:12:02 +10:00
fix: inline the remember package
This commit is contained in:
18
packages/prisma/utils/remember.ts
Normal file
18
packages/prisma/utils/remember.ts
Normal file
@ -0,0 +1,18 @@
|
||||
declare global {
|
||||
// eslint-disable-next-line no-var, @typescript-eslint/no-explicit-any
|
||||
var __prisma_remember: Map<string, any>;
|
||||
}
|
||||
|
||||
export function remember<T>(name: string, getValue: () => T): T {
|
||||
const thusly = globalThis;
|
||||
|
||||
if (!thusly.__prisma_remember) {
|
||||
thusly.__prisma_remember = new Map();
|
||||
}
|
||||
|
||||
if (!thusly.__prisma_remember.has(name)) {
|
||||
thusly.__prisma_remember.set(name, getValue());
|
||||
}
|
||||
|
||||
return thusly.__prisma_remember.get(name);
|
||||
}
|
||||
Reference in New Issue
Block a user