Files
memecoin-botV2/.pnpm-store/v10/files/9d/45b9d51072adfcaa41e448741fd339b7868a5bc1c3c22df30513744fed2b9643cb37decb36a355bfa8a72211ae877056f2e4f3b3b23a6a640912b62977d76e

22 lines
668 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NullThrowsReasons = void 0;
exports.nullThrows = nullThrows;
/**
* A set of common reasons for calling nullThrows
*/
exports.NullThrowsReasons = {
MissingParent: 'Expected node to have a parent.',
MissingToken: (token, thing) => `Expected to find a ${token} for the ${thing}.`,
};
/**
* Assert that a value must not be null or undefined.
* This is a nice explicit alternative to the non-null assertion operator.
*/
function nullThrows(value, message) {
if (value == null) {
throw new Error(`Non-null Assertion Failed: ${message}`);
}
return value;
}