7de55408946d2a10cb7e3d578c26788ce6fa4ffff9ad2befbf59e5d7f03f50e1813adb9824884f3ab90421c4a615b0ea7ba1a092fcbb4baca5f3b956dccfa1 625 B

123456789101112
  1. /*---------------------------------------------------------------------------------------------
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Licensed under the MIT License. See License.txt in the project root for license information.
  4. *--------------------------------------------------------------------------------------------*/
  5. /**
  6. * Throws an error with the provided message if the provided value does not evaluate to a true Javascript value.
  7. */
  8. export function ok(value, message) {
  9. if (!value) {
  10. throw new Error(message ? `Assertion failed (${message})` : 'Assertion Failed');
  11. }
  12. }