Compact UTC timestamp `YYYYMMDDHHmmss` (numeric, stable-sorting)
(date: Date)
| 55 | |
| 56 | /** Compact UTC timestamp `YYYYMMDDHHmmss` (numeric, stable-sorting) */ |
| 57 | function utcTimestamp(date: Date): string { |
| 58 | const p = (n: number, len = 2) => String(n).padStart(len, '0'); |
| 59 | return ( |
| 60 | `${p(date.getUTCFullYear(), 4)}${p(date.getUTCMonth() + 1)}${p(date.getUTCDate())}` + |
| 61 | `${p(date.getUTCHours())}${p(date.getUTCMinutes())}${p(date.getUTCSeconds())}` |
| 62 | ); |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * Resolve a snapshot request: sanitize the name, pick the dist-tag, and compute the |
no test coverage detected
searching dependent graphs…