Description
Objects returned from resolvedOptions()
sometimes omit fields, but generally only when they have no meaningful interpretation (e.g., NumberFormat {minimum,maximum}{Fraction,Significant}Digits or Collator numeric
/caseFirst
when those are not relevant extension keys).
But DurationFormat omits fractionalDigits
whenever input options do not define a numeric value for it, which seems odd. Rather than having Object.getOwnPropertyDescriptor(new Intl.DurationFormat().resolvedOptions(), "fractionalDigits")
return undefined
(implicitly propagating a value that might be defined on Object.prototype
), I'd like to see it return { value: undefined, writable: true, enumerable: true, configurable: true }
, such that the shape of returned objects is always consistent.