@visulima/humanizer
Version:
Humanizer is a library for humanizing data in a human-readable form.
18 lines (15 loc) • 598 B
JavaScript
import createDurationLanguage from './util/create-duration-language.mjs';
const durationLanguage = createDurationLanguage(
(counter) => `ano${counter === 1 ? "" : "s"}`,
(counter) => counter === 1 ? "mês" : "meses",
(counter) => `semana${counter === 1 ? "" : "s"}`,
(counter) => `dia${counter === 1 ? "" : "s"}`,
(counter) => `hora${counter === 1 ? "" : "s"}`,
(counter) => `minuto${counter === 1 ? "" : "s"}`,
(counter) => `segundo${counter === 1 ? "" : "s"}`,
(counter) => `milissegundo${counter === 1 ? "" : "s"}`,
"em %s",
"há %s",
","
);
export { durationLanguage };