(val: Value | null | undefined)
| 64 | } |
| 65 | |
| 66 | export function assertNumber(val: Value | null | undefined): asserts val is VNum { |
| 67 | if (val == null) { |
| 68 | throw new AiScriptRuntimeError('Expect number, but got nothing.'); |
| 69 | } |
| 70 | if (!isNumber(val)) { |
| 71 | throw new AiScriptRuntimeError(`Expect number, but got ${val.type}.`); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | export function assertObject(val: Value | null | undefined): asserts val is VObj { |
| 76 | if (val == null) { |
no test coverage detected