MCPcopy
hub / github.com/microsoft/vscode / ok

Function ok

src/vs/base/common/assert.ts:22–26  ·  view source on GitHub ↗
(value?: unknown, message?: string)

Source from the content-addressed store, hash-verified

20 * Thus, the `assert(...)` function should be used instead.
21 */
22export function ok(value?: unknown, message?: string) {
23 if (!value) {
24 throw new Error(message ? `Assertion failed (${message})` : 'Assertion Failed');
25 }
26}
27
28export function assertNever(value: never, message = 'Unreachable'): never {
29 throw new Error(message);

Calls

no outgoing calls

Tested by 14

assertCommandsFunction · 0.72
profilesEqualFunction · 0.72
getConfigAfterWrapFunction · 0.72
invokeToolTestFunction · 0.72
assertAutoApprovedFunction · 0.72
assertDropdownActionsFunction · 0.72
assertStatusFunction · 0.72
assertPromptInputFunction · 0.72
assertIsEnabledFunction · 0.72