UNPKG

vike

Version:

The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.

19 lines (18 loc) 718 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.addIs404ToPageProps = addIs404ToPageProps; const utils_js_1 = require("./utils.js"); function addIs404ToPageProps(pageContext) { addIs404(pageContext); } function addIs404(pageContext) { if (pageContext.is404 === undefined || pageContext.is404 === null) return; const pageProps = pageContext.pageProps || {}; if (!(0, utils_js_1.isObject)(pageProps)) { (0, utils_js_1.assertWarning)(false, 'pageContext.pageProps should be an object', { showStackTrace: true, onlyOnce: true }); return; } pageProps.is404 = pageProps.is404 || pageContext.is404; pageContext.pageProps = pageProps; }