Ember Inflector
Ember Inflector is a library for inflecting words between plural and singular forms. Ember Inflector aims to be compatible with ActiveSupport::Inflector from Ruby on Rails, including the ability to add your own inflections in your app.
Installation
Ember CLI/NPM:
npm install --save ember-inflector
Usage
All methods are always available from Ember.Inflector
, but in Ember CLI, you can always import
instead:
import Inflector from 'ember-inflector';
import {singularize, pluralize} from 'ember-inflector';
Inflector.inflector.singularize("tacos");
Inflector.inflector.pluralize("taco");
singularize("tacos");
pluralize("taco");
Ember.Inflector.inflector.pluralize("taco");