(val: Value | null | undefined)
| 82 | } |
| 83 | |
| 84 | export function assertArray(val: Value | null | undefined): asserts val is VArr { |
| 85 | if (val == null) { |
| 86 | throw new AiScriptRuntimeError('Expect array, but got nothing.'); |
| 87 | } |
| 88 | if (!isArray(val)) { |
| 89 | throw new AiScriptRuntimeError(`Expect array, but got ${val.type}.`); |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | export function assertNull(val: Value | null | undefined): asserts val is VNull { |
| 94 | if (val == null) { |
no test coverage detected