()
| 252 | ) |
| 253 | } |
| 254 | resolvedOptions(): ResolvedDurationFormatOptions { |
| 255 | if ( |
| 256 | typeof this !== 'object' || |
| 257 | !OrdinaryHasInstance(DurationFormat, this) |
| 258 | ) { |
| 259 | throw TypeError( |
| 260 | 'Method Intl.DurationFormat.prototype.resolvedOptions called on incompatible receiver' |
| 261 | ) |
| 262 | } |
| 263 | const internalSlots = getInternalSlots(this) |
| 264 | const ro: Record<string, unknown> = {} |
| 265 | for (const key of RESOLVED_OPTIONS_KEYS) { |
| 266 | let v = internalSlots[key] |
| 267 | if (key === 'fractionalDigits') { |
| 268 | if (v !== undefined) { |
| 269 | v = Number(v) |
| 270 | } |
| 271 | } else if (v === 'fractional') { |
| 272 | v = 'numeric' |
| 273 | } else { |
| 274 | invariant(v !== undefined, `Missing internal slot ${key}`) |
| 275 | } |
| 276 | ro[key] = v |
| 277 | } |
| 278 | return ro as any |
| 279 | } |
| 280 | formatToParts(duration: DurationInput): DurationFormatPart[] { |
| 281 | const locInternalSlots = getInternalSlots(this) |
| 282 | if (locInternalSlots.initializedDurationFormat === undefined) { |
nothing calls this directly
no test coverage detected