big-moving.ru/api/soft/monako/esm/vs/base/common/assert.js

13 lines
630 B
JavaScript
Raw Normal View History

2022-06-24 15:29:23 +05:00
/*---------------------------------------------------------------------------------------------
* 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, message) {
if (!value) {
throw new Error(message ? 'Assertion failed (' + message + ')' : 'Assertion Failed');
}
}