UNPKG

@visulima/humanizer

Version:

Humanizer is a library for humanizing data in a human-readable form.

10 lines (9 loc) 532 B
import type { ParseDurationOptions } from "./types.d.ts"; /** * Parses a human-readable duration string into milliseconds using specified language units. * @param value The string to parse (e.g., "1h 20min", "2 days", "-3 hafta"). * @param options Optional configuration including language and default unit. * @returns The duration in milliseconds, or undefined if the string cannot be parsed. */ declare const parseDuration: (value: string, options?: ParseDurationOptions) => number | undefined; export default parseDuration;