mirror of
https://github.com/penpot/penpot.git
synced 2026-03-06 18:21:09 +00:00
24 lines
456 B
TypeScript
24 lines
456 B
TypeScript
let isLockedDown = false;
|
|
|
|
export const ses = {
|
|
hardenIntrinsics: () => {
|
|
if (!isLockedDown) {
|
|
isLockedDown = true;
|
|
hardenIntrinsics();
|
|
}
|
|
},
|
|
createCompartment: (globals?: object) => {
|
|
return new Compartment(globals);
|
|
},
|
|
harden: (obj: object) => {
|
|
return harden(obj);
|
|
},
|
|
safeReturn<T>(value: T): T {
|
|
if (value === null || value === undefined) {
|
|
return value;
|
|
}
|
|
|
|
return harden(value) as T;
|
|
},
|
|
};
|