MCPcopy Create free account
hub / github.com/PageLeay/celestial-runtime / assertArgument

Function assertArgument

lib.commonjs/utils/errors.js:168–170  ·  view source on GitHub ↗

* A simple helper to simply ensuring provided arguments match expected * constraints, throwing if not. * * In TypeScript environments, the %%check%% has been asserted true, so * any further code does not need additional compile-time checks.

(check, message, name, value)

Source from the content-addressed store, hash-verified

166 * any further code does not need additional compile-time checks.
167 */
168function assertArgument(check, message, name, value) {
169 assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value });
170}
171exports.assertArgument = assertArgument;
172function assertArgumentCount(count, expectedCount, message) {
173 if (message == null) {

Callers

nothing calls this directly

Calls 1

assertFunction · 0.70

Tested by

no test coverage detected