import {isomorphicGlobal} from "../check-environment"; export function hideGlobal(varName: string, newValue: any) { // const hideGlobal = (varName,newValue) => { const old = isomorphicGlobal[varName]; delete isomorphicGlobal[varName]; isomorphicGlobal[varName] = newValue; return () => { delete isomorphicGlobal[varName]; if (old !== undefined) { isomorphicGlobal[varName] = isomorphicGlobal; } }; }