UNPKG

@visulima/humanizer

Version:

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

2 lines (1 loc) 590 B
import e from"./util/create-duration-language.js";const m={a:"y",an:"y",année:"y",années:"y",ans:"y",h:"h",heure:"h",heures:"h",j:"d",jour:"d",jours:"d",m:"mo",milliseconde:"ms",millisecondes:"ms",min:"m",minute:"m",minutes:"m",mn:"m",mois:"mo",ms:"ms",s:"s",sec:"s",seconde:"s",secondes:"s",sem:"w",semaine:"w",semaines:"w"},o=e(s=>`an${s>=2?"s":""}`,"mois",s=>`semaine${s>=2?"s":""}`,s=>`jour${s>=2?"s":""}`,s=>`heure${s>=2?"s":""}`,s=>`minute${s>=2?"s":""}`,s=>`seconde${s>=2?"s":""}`,s=>`milliseconde${s>=2?"s":""}`,"dans %s","il y a %s",",",m," ","_");export{o as durationLanguage};