UNPKG

vremel

Version:

JavaScript date utility library for Temporal API

11 lines 409 B
import { compare } from "./_compare.js"; /** * Returns the shortest of the given durations. * @param durations array of durations * @param options the options passed to `Temporal.Duration.compare` * @returns the shortest of the duration */ export function shortest(durations, options) { return durations.reduce((a, b) => (compare(a, b, options) === 1 ? b : a)); } //# sourceMappingURL=shortest.js.map