(key: string, value: string)
| 678 | } |
| 679 | |
| 680 | const paxInteger = (key: string, value: string): number => { |
| 681 | const n = /^\d+$/.test(value) ? Number(value) : Number.NaN |
| 682 | if (!Number.isSafeInteger(n)) { |
| 683 | throw invalidHeader(`invalid PAX ${key} ${JSON.stringify(value)}`) |
| 684 | } |
| 685 | return n |
| 686 | } |
| 687 | |
| 688 | // Parses a PAX time of decimal seconds into milliseconds, rounded down. The |
| 689 | // digits are added up separately, because `Number(value) * 1000` is inexact. |
no test coverage detected