fix: harden prerender publication boundary
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user