mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-01 09:35:41 -05:00
14 lines
634 B
TypeScript
14 lines
634 B
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. 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?: any, message?: string) {
|
|
if (!value) {
|
|
throw new Error(message ? 'Assertion failed (' + message + ')' : 'Assertion Failed');
|
|
}
|
|
}
|