fix: harden prerender publication boundary

This commit is contained in:
2026-09-02 02:44:23 +03:00
parent 3dd4a818d0
commit c16c4c57da
22 changed files with 1275 additions and 231 deletions

View File

@@ -1,4 +1,5 @@
import { createApp } from './app';
import { validateAndFreezeProductionInputSnapshot } from './content/production-input-snapshot';
import type { ProductionInputs } from './content/types';
export const readProductionInputsSnapshot = (source: Document): Readonly<ProductionInputs> => {
@@ -16,7 +17,7 @@ export const readProductionInputsSnapshot = (source: Document): Readonly<Product
throw new Error('The inert portfolio input snapshot is empty.');
}
return JSON.parse(serializedInputs) as Readonly<ProductionInputs>;
return validateAndFreezeProductionInputSnapshot(JSON.parse(serializedInputs) as unknown);
};
const appRoot = document.getElementById('app');