vike
Version:
The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.
9 lines (8 loc) • 468 B
JavaScript
export { forkPageContext };
import { objectAssign } from '../utils/objectAssign.js';
// Create pageContext forks to avoid leaks: upon an error (bug or abort) a brand new pageContext object is created, in order to avoid previous pageContext modifications that are now obsolete to leak to the new pageContext object.
function forkPageContext(pageContext) {
const pageContextNew = {};
objectAssign(pageContextNew, pageContext, true);
return pageContextNew;
}