UNPKG

libre-routing

Version:

This library was generated with [Nx](https://nx.dev).

13 lines 456 B
import parseMilliseconds from 'parse-ms'; export function formatMS(ms) { const { days, seconds, minutes, hours } = parseMilliseconds(ms); if (days === 0 && hours === 0 && minutes === 0) return `${seconds}s`; else if (days === 0 && hours === 0) return `${minutes}m ${seconds} s`; else if (days === 0) return `${hours}h ${minutes}m`; else return `${days * 24 + hours}h`; } //# sourceMappingURL=utils.js.map