( condition: any, msg?: string | Error, )
| 180 | } |
| 181 | |
| 182 | export function assert( |
| 183 | condition: any, |
| 184 | msg?: string | Error, |
| 185 | ): asserts condition { |
| 186 | if (!condition) { |
| 187 | error(msg || 'unknow reason'); |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | export function toBoolean(val: any) { |
| 192 | if (val === '') return true; |