UNPKG

ember-inflector

Version:

The default blueprint for Embroider v2 addons.

31 lines (27 loc) 791 B
/* eslint-disable import/extensions */ import { pluralize } from 'ember-inflector'; import makeHelper from '../lib/utils/make-helper'; /** * * If you have Ember Inflector (such as if Ember Data is present), * pluralize a word. For example, turn "ox" into "oxen". * * Example: * * {{pluralize count myProperty}} * {{pluralize 1 "oxen"}} * {{pluralize myProperty}} * {{pluralize "ox"}} * * @for Ember.HTMLBars.helpers * @method pluralize * @param {Number|Property} [count] count of objects * @param {String|Property} word word to pluralize */ export default makeHelper(function (params, hash) { let fullParams = new Array(...params); if (fullParams.length === 2) { fullParams.push({ withoutCount: hash['without-count'] }); } return pluralize(...fullParams); });