Download packages/core/src/utils/checks.ts from SaylorTwift/gemini-cli: direct link, hf CLI and curl.
- Browser
- Download file 568 Bytes
-
https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/core/src/utils/checks.ts
- Command line
-
hf download hf://SaylorTwift/gemini-cli/packages/core/src/utils/checks.ts
-
curl -L -o checks.ts https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/core/src/utils/checks.ts
568 Bytes
| /** | |
| * @license | |
| * Copyright 2025 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| /* Fail to compile on unexpected values. */ | |
| export function assumeExhaustive(_value: never): void {} | |
| /** | |
| * Throws an exception on unexpected values. | |
| * | |
| * A common use case is switch statements: | |
| * switch(enumValue) { | |
| * case Enum.A: | |
| * case Enum.B: | |
| * break; | |
| * default: | |
| * checkExhaustive(enumValue); | |
| * } | |
| */ | |
| export function checkExhaustive( | |
| value: never, | |
| msg = `unexpected value ${value}!`, | |
| ): never { | |
| assumeExhaustive(value); | |
| throw new Error(msg); | |
| } | |