Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

plur

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

plur - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

8

index.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc