-
d57f030: Return null from ms(string) if no duration strings are found within input
-
8d0b67c: Locales are now tree-shakeable, reducing bundle size for consumers who only need a single locale. Import your locale directly instead of passing a string.
- ms({ language: 'de' }) + import de from 'enhanced-ms/locales/de'; + const ms = createMs({ language: de }) + ms()
- 8d0b67c: Format throughput improved by up to 5x. The internal pipeline was reduced from four passes to one, with option presets cached at module load so common calls make zero allocations.
- 8d0b67c: Parse throughput improved by ~25% and GC pressure reduced at runtime. Language definitions are no longer mutated on compile, and memory usage per unit dropped from N allocations to one.
- fecdea7: Add support for Portuguese
- d59d860: Add support for Polish, Czech, and Chinese (Simplified)
- 37840a3: Added language support for Dutch, French, Italian and Spanish
- 10d9b89: Fixed handling of
includeMsandincludeSubMsoptions
-
8d46d9d: Codebase rewrite to improve readability and performance
-
Added new
createMsfunction to create a new instance ofmswith custom language and formatting options- With this change, the
msfunction no longer accepts a language via its parameters, usecreateMsinstead
- With this change, the
-
Improved performance of formatting milliseconds by up to 10%
-
Added additional options to
FormatOptionsfor more customisation- Replaced
shortFormatwithuseAbbreviations - Added
hideUnitNames,includeZero,includedUnits,unitLimit,unitSeparator,minimumDigits - Added format option presets:
short,fullPrecision,colonNotation
- Replaced
-
Improved base performance of parsing durations by up to 1,100%
-
Removed ability for parse to handle maths operators, this will likely be re-added in a future version as an option
-