Comparing version 2.1.1 to 2.1.2
@@ -5,7 +5,9 @@ 'use strict'; | ||
module.exports = function (str, plural, count) { | ||
if (typeof plural === 'number') { | ||
count = plural; | ||
} | ||
if (str in irregularPlurals) { | ||
plural = irregularPlurals[str]; | ||
} else if (typeof plural === 'number') { | ||
count = plural; | ||
} else if (typeof plural !== 'string') { | ||
plural = (str.replace(/(?:s|x|z|ch|sh)$/i, '$&e').replace(/([^aeiou])y$/i, '$1ie') + 's') | ||
@@ -12,0 +14,0 @@ .replace(/i?e?s$/i, function (m) { |
{ | ||
"name": "plur", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Pluralize a word", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -45,6 +45,9 @@ # plur [![Build Status](https://travis-ci.org/sindresorhus/plur.svg?branch=master)](https://travis-ci.org/sindresorhus/plur) | ||
Type: `string` | ||
Default: Words ending in *s*, *x*, *z*, *ch*, *sh* will be pluralized with *-es*, like | ||
*foxes*. Words ending in *y* will be pluralized by replacing *y* with *-ies* as | ||
in *puppies*. Irregular nouns will use this [list](https://github.com/sindresorhus/irregular-plurals/blob/master/irregular-plurals.json). | ||
Default: | ||
- Irregular nouns will use this [list](https://github.com/sindresorhus/irregular-plurals/blob/master/irregular-plurals.json). | ||
- Words ending in *s*, *x*, *z*, *ch*, *sh* will be pluralized with *-es* (eg. *foxes*). | ||
- Words ending in *y* that are preceded by a consonant will be pluralized by replacing *y* with *-ies* (eg. *puppies*). | ||
- All other words will have "s" added to the end (eg. *days*). | ||
Pluralized word. | ||
@@ -51,0 +54,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3609
17
68