@visulima/humanizer
Version:
Humanizer is a library for humanizing data in a human-readable form.
22 lines (19 loc) • 547 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");
module.exports = getSlavicForm;