(value: unknown)
| 35 | * @returns Primitive text, or undefined for objects and functions. |
| 36 | */ |
| 37 | export function primitiveText(value: unknown): string | undefined { |
| 38 | if (value === null) return 'null' |
| 39 | switch (typeof value) { |
| 40 | case 'string': |
| 41 | case 'number': |
| 42 | case 'boolean': |
| 43 | case 'bigint': |
| 44 | case 'symbol': |
| 45 | case 'undefined': |
| 46 | return String(value) |
| 47 | default: |
| 48 | return undefined |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Reads finite entries through native collection methods and own descriptors. |
no outgoing calls
no test coverage detected