Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
ember-inflector
Advanced tools
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.
ember install ember-inflector
All methods are always available from the ember-inflector
module:
import Inflector from 'ember-inflector';
import { singularize, pluralize } from 'ember-inflector';
Inflector.inflector.singularize("tacos"); // taco
Inflector.inflector.pluralize("taco"); // tacos
singularize("tacos"); // taco
pluralize("taco"); // tacos
pluralize(2, "taco"); // 2 tacos
pluralize(2, "tacos", { withoutCount: true }); // tacos
If necessary you can setup special inflection rules for your application:
import Inflector from 'ember-inflector';
Inflector.inflector.irregular('person', 'people');
Inflector.inflector.uncountable('sheep');
Pluralize a word
{{pluralize "taco"}} -> tacos
Specify a count with the word, with the pluralization being based on the number of items.
{{pluralize 1 "taco"}} -> 1 taco
{{pluralize 2 "taco"}} -> 2 tacos
Specify a count with the word, with the pluralization being based on the number of items. Specify without-count=true
to return on the word without the number.
{{pluralize 1 "taco" without-count=true}} -> taco
{{pluralize 2 "taco" without-count=true}} -> tacos
{{singularize 'octopi'}} -> octopus
See the Contributing guide for details.
This project is licensed under the MIT License.
FAQs
The default blueprint for Embroider v2 addons.
The npm package ember-inflector receives a total of 66,716 weekly downloads. As such, ember-inflector popularity was classified as popular.
We found that ember-inflector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.