MCPcopy Create free account
hub / github.com/aiscript-dev/aiscript / expectAny

Function expectAny

src/interpreter/util.ts:5–9  ·  view source on GitHub ↗
(val: Value | null | undefined)

Source from the content-addressed store, hash-verified

3import type { Value, VStr, VNum, VBool, VFn, VObj, VArr, VNull } from './value.js';
4
5export function expectAny(val: Value | null | undefined): asserts val is Value {
6 if (val == null) {
7 throw new AiScriptRuntimeError('Expect anything, but got nothing.');
8 }
9}
10
11export function isBoolean(val: Value): val is VBool {
12 return val.type === 'bool';

Callers 6

constructorMethod · 0.85
_fnMethod · 0.85
_fnSyncMethod · 0.85
primitive-props.tsFile · 0.85
math.tsFile · 0.85
std.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected