(val: Value | null | undefined)
| 73 | } |
| 74 | |
| 75 | export function assertObject(val: Value | null | undefined): asserts val is VObj { |
| 76 | if (val == null) { |
| 77 | throw new AiScriptRuntimeError('Expect object, but got nothing.'); |
| 78 | } |
| 79 | if (!isObject(val)) { |
| 80 | throw new AiScriptRuntimeError(`Expect object, but got ${val.type}.`); |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | export function assertArray(val: Value | null | undefined): asserts val is VArr { |
| 85 | if (val == null) { |
no test coverage detected