diff options
Diffstat (limited to '')
-rw-r--r-- | typescript/src/typescriptExhaustive.ts | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/typescript/src/typescriptExhaustive.ts b/typescript/src/typescriptExhaustive.ts new file mode 100644 index 0000000..656a419 --- /dev/null +++ b/typescript/src/typescriptExhaustive.ts @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: AGPL-3.0-or-later */ + +import type EntrypointParameter from "./EntrypointParameter.js"; +import typescriptNever from "./typescriptNever.js"; + +export default (EntrypointParameter: EntrypointParameter): void => { + Object.freeze(EntrypointParameter); + + if (typeof EntrypointParameter.input !== "string") { + typescriptNever(EntrypointParameter.input); + } + + if (EntrypointParameter.i2d !== true) { + if (EntrypointParameter.i2d !== undefined) { + typescriptNever(EntrypointParameter.i2d); + } + } + + if (!(EntrypointParameter.podstate instanceof Array)) { + typescriptNever(EntrypointParameter.podstate); + } + + if (EntrypointParameter.podstate.length !== 3) { + if (EntrypointParameter.podstate.length !== 4) { + typescriptNever(EntrypointParameter.podstate.length); + } + } + + if (EntrypointParameter.podstate[0] !== "Step-by-step solution") { + typescriptNever(EntrypointParameter.podstate[0]); + } + + if (EntrypointParameter.podstate[1] !== "Step-by-step") { + typescriptNever(EntrypointParameter.podstate[1]); + } + + if (EntrypointParameter.podstate[2] !== "Show all steps") { + typescriptNever(EntrypointParameter.podstate[2]); + } + + if (typeof EntrypointParameter.podstate[3] !== "string") { + if (typeof EntrypointParameter.podstate[3] !== "undefined") { + typescriptNever(EntrypointParameter.podstate[3]); + } + } +}; |