| 414 | |
| 415 | // objects are compared by reference, except dates, which units compare by value |
| 416 | const literalKeyOf = (v: unknown): string => |
| 417 | typeof v === "string" ? JSON.stringify(v) |
| 418 | : typeof v === "number" ? |
| 419 | Object.is(v, -0) ? |
| 420 | "-0" |
| 421 | : `${v}` |
| 422 | : typeof v === "bigint" ? `${v}n` |
| 423 | : isDate(v) ? dateKeyOf(v) |
| 424 | : ( |
| 425 | (typeof v === "object" && v !== null) || |
| 426 | typeof v === "function" || |
| 427 | typeof v === "symbol" |
| 428 | ) ? |
| 429 | `$${nameOf(v)}` |
| 430 | : `${v}` |
| 431 | |
| 432 | const dateKeyOf = (v: Date): string => { |
| 433 | const time = timeOf(v) |