(input: unknown)
| 36 | } |
| 37 | |
| 38 | function plain(input: unknown): input is Record<string, unknown> { |
| 39 | if (input === null || typeof input !== "object" || Array.isArray(input)) return false |
| 40 | const prototype = Object.getPrototypeOf(input) |
| 41 | return prototype === Object.prototype || prototype === null |
| 42 | } |
| 43 | |
| 44 | function format(input: unknown) { |
| 45 | const value = typeof input === "string" ? input : Formatter.format(input) |