UNPKG

superflected

Version:

A port of ActiveSupport's inflector to Node.js

8 lines (7 loc) 457 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.pluralize = void 0; const applyInflections_1 = require("./applyInflections"); const cacheable_1 = require("./cacheable"); const Inflector_1 = require("./Inflector"); exports.pluralize = (0, cacheable_1.cacheable)((word, locale = "en") => (0, applyInflections_1.applyInflections)(word, (0, Inflector_1.inflections)(locale).plurals), (word, locale) => `${word}-${locale}`);