summaryrefslogtreecommitdiffstats
path: root/typescript/src/typescriptNever.ts
diff options
context:
space:
mode:
authorname <email@example.com>2023-09-27 13:34:23 +0200
committername <email@example.com>2023-09-27 13:34:23 +0200
commit72d8b4e6bee0ffac79e96dd649a9da2adb86b507 (patch)
tree8d1f37e5d88a598675b1a65128c35323c99825f5 /typescript/src/typescriptNever.ts
parentMerge pull request 'Please consider adding my instance' (#2) from superprivacy/wolfree-dockerfile:main into main (diff)
downloadwolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar.gz
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar.bz2
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar.lz
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar.xz
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar.zst
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.zip
Diffstat (limited to 'typescript/src/typescriptNever.ts')
-rw-r--r--typescript/src/typescriptNever.ts10
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