@visulima/humanizer
Version:
Humanizer is a library for humanizing data in a human-readable form.
20 lines (18 loc) • 537 B
JavaScript
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
const getSlavicForm = /* @__PURE__ */ __name((counter) => {
if (Math.floor(counter) !== counter) {
return 2;
}
if (counter % 100 >= 5 && counter % 100 <= 20 || counter % 10 >= 5 && counter % 10 <= 9 || counter % 10 === 0) {
return 0;
}
if (counter % 10 === 1) {
return 1;
}
if (counter > 1) {
return 2;
}
return 0;
}, "getSlavicForm");
export { getSlavicForm as default };