mirror of
https://github.com/coder/code-server.git
synced 2026-06-11 12:37:10 +02:00
Squashed 'lib/vscode/' content from commit e5a624b788
git-subtree-dir: lib/vscode git-subtree-split: e5a624b788d92b8d34d1392e4c4d9789406efe8f
This commit is contained in:
13
src/vs/base/common/assert.ts
Normal file
13
src/vs/base/common/assert.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Throws an error with the provided message if the provided value does not evaluate to a true Javascript value.
|
||||
*/
|
||||
export function ok(value?: unknown, message?: string) {
|
||||
if (!value) {
|
||||
throw new Error(message ? `Assertion failed (${message})` : 'Assertion Failed');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user