From b057c6f308a701c0196b76fa7f48123797ea2826 Mon Sep 17 00:00:00 2001 From: Pierric Cistac Date: Thu, 25 Feb 2021 15:21:25 -0500 Subject: [PATCH] fix: `URLParams` typing in demo with new `diffTooBigMessage` option --- website/templates/pages/demo/demo.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/website/templates/pages/demo/demo.ts b/website/templates/pages/demo/demo.ts index 42eccae..e5140db 100644 --- a/website/templates/pages/demo/demo.ts +++ b/website/templates/pages/demo/demo.ts @@ -21,6 +21,7 @@ import './demo.css'; type URLParams = { diff?: string; + diffTooBigMessage?: string; [key: string]: string | boolean | number | undefined; }; @@ -116,13 +117,13 @@ function prepareRequest(url: string): Request { } function getConfiguration(urlParams: URLParams): Diff2HtmlUIConfig { - // Removing `diff` form `urlParams` to avoid being inserted + // Removing `diff` and `diffTooBigMessage` form `urlParams` to avoid being inserted // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { diff, ...urlParamsRest } = urlParams; - const config: URLParams = { + const { diff, diffTooBigMessage, ...urlParamsRest } = urlParams; + const config = ({ ...defaultDiff2HtmlUIConfig, ...urlParamsRest, - }; + } as unknown) as URLParams; return Object.entries(config).reduce((object, [k, v]) => { const newObject = !Number.isNaN(Number(v))