(value: any)
| 295 | } |
| 296 | |
| 297 | function getNodeType(value: any): NodeType { |
| 298 | switch (typeof value) { |
| 299 | case "boolean": |
| 300 | return "boolean"; |
| 301 | case "number": |
| 302 | return "number"; |
| 303 | case "string": |
| 304 | return "string"; |
| 305 | case "object": { |
| 306 | if (!value) { |
| 307 | return "null"; |
| 308 | } else if (Array.isArray(value)) { |
| 309 | return "array"; |
| 310 | } |
| 311 | return "object"; |
| 312 | } |
| 313 | default: |
| 314 | return "null"; |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | function maybeIterable(v: string) { |
| 319 | return typeof v === "string" && (/^\s*\{.*\}\s*$/.test(v) || /^\s*\[.*\]\s*$/.test(v)); |