Returns true if the value is a string, number, or boolean
(node: any)
| 12 | export class is { |
| 13 | /** Returns true if the value is a string, number, or boolean */ |
| 14 | static primitive(node: any): node is Primitive { |
| 15 | switch (typeof node) { |
| 16 | case 'boolean': |
| 17 | case 'number': |
| 18 | case 'string': |
| 19 | return true; |
| 20 | } |
| 21 | return false; |
| 22 | } |
| 23 | |
| 24 | static object(node: any): node is Record<string, any> { |
| 25 | return typeof node === 'object' && node !== null && !is.array(node); |