8000 fix: `URLParams` typing in demo with new `diffTooBigMessage` option · huggingface/diff2html@b057c6f · GitHub
[go: up one dir, main page]

Skip to content

Commit b057c6f

Browse files
committed
fix: URLParams typing in demo with new diffTooBigMessage option
1 parent 9aa2ea9 commit b057c6f

File tree

1 file changed

+5
-4
lines changed
  • website/templates/pages/demo

1 file changed

+5
-4
lines changed

website/templates/pages/demo/demo.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import './demo.css';
2121

2222
type URLParams = {
2323
diff?: string;
24+
diffTooBigMessage?: string;
2425
[key: string]: string | boolean | number | undefined;
2526
};
2627

@@ -116,13 +117,13 @@ function prepareRequest(url: string): Request {
116117
}
117118

118119
function getConfiguration(urlParams: URLParams): Diff2HtmlUIConfig {
119-
// Removing `diff` form `urlParams` to avoid being inserted
120+
// Removing `diff` and `diffTooBigMessage` form `urlParams` to avoid being inserted
120121
// eslint-disable-next-line @typescript-eslint/no-unused-vars
121-
const { diff, ...urlParamsRest } = urlParams;
122-
const config: URLParams = {
122+
const { diff, diffTooBigMessage, ...urlParamsRest } = urlParams;
123+
const config = ({
123124
...defaultDiff2HtmlUIConfig,
124125
...urlParamsRest,
125-
};
126+
} as unknown) as URLParams;
126127

127128
return 3FE0 Object.entries(config).reduce((object, [k, v]) => {
128129
const newObject = !Number.isNaN(Number(v))

0 commit comments

Comments
 (0)
0