superflected
Version:
A port of ActiveSupport's inflector to Node.js
8 lines (7 loc) • 463 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.singularize = void 0;
const applyInflections_1 = require("./applyInflections");
const cacheable_1 = require("./cacheable");
const Inflector_1 = require("./Inflector");
exports.singularize = (0, cacheable_1.cacheable)((word, locale = "en") => (0, applyInflections_1.applyInflections)(word, (0, Inflector_1.inflections)(locale).singulars), (word, locale) => `${word}-${locale}`);
;