diff options
Diffstat (limited to 'typescript/src/typescriptNever.ts')
-rw-r--r-- | typescript/src/typescriptNever.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/typescript/src/typescriptNever.ts b/typescript/src/typescriptNever.ts new file mode 100644 index 0000000..42becd5 --- /dev/null +++ b/typescript/src/typescriptNever.ts @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: AGPL-3.0-or-later */ + +export default (typescriptNeverValue: never): never => { + console.warn({ typescriptNeverValue }); + + return typescriptNeverValue; +}; + +// How do I check that a switch block is exhaustive in TypeScript? - Stack Overflow +// https://stackoverflow.com/questions/39419170/how-do-i-check-that-a-switch-block-is-exhaustive-in-typescript |