Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance ParseDuration with configurable parsing options
Introduce ParseDuration() as the primary and simplest entrypoint for parsing durations. By default it operates in "single-unit mode", meaning only one unit type is allowed per input string (e.g., "1d" as opposed to permitting "1d3h5m"). Assumes milliseconds as the default unit when none is specified. In addition, a new parser configuration is introduced which provides flexibility to specify a subset of permissible units. Allows custom defaults and parsing behaviors tailored for specific use cases.
- Loading branch information