(value: number, unit: Intl.RelativeTimeFormatUnit)
| 30 | }) |
| 31 | } |
| 32 | format(value: number, unit: Intl.RelativeTimeFormatUnit): string { |
| 33 | if (typeof this !== 'object') { |
| 34 | throw new TypeError('format was called on a non-object') |
| 35 | } |
| 36 | const internalSlots = getInternalSlots(this) |
| 37 | if (!internalSlots.initializedRelativeTimeFormat) { |
| 38 | throw new TypeError('format was called on a invalid context') |
| 39 | } |
| 40 | return PartitionRelativeTimePattern( |
| 41 | this, |
| 42 | Number(value), |
| 43 | ToString(unit) as Intl.RelativeTimeFormatUnit, |
| 44 | { |
| 45 | getInternalSlots, |
| 46 | } |
| 47 | ) |
| 48 | .map(el => el.value) |
| 49 | .join('') |
| 50 | } |
| 51 | formatToParts( |
| 52 | value: number, |
| 53 | unit: Intl.RelativeTimeFormatUnit |
nothing calls this directly
no test coverage detected