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

english-plurals

Package Overview
Dependencies
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

english-plurals - npm Package Compare versions

Comparing version 0.8.9 to 0.8.10

8

dist/index.d.ts
export interface IrregularPlurals {
[key: string]: string;
}
export declare function getPlural(irregulars: IrregularPlurals, singular: string): string;
export interface WordInfo {
plural: string;
}
export interface WordsInfo {
[key: string]: WordInfo;
}
export declare function getPlural(wordsInfo: WordsInfo, irregulars: IrregularPlurals, singular: string): string;

7

dist/index.js

@@ -38,3 +38,3 @@ "use strict";

const consonants = 'bcdfghjklmnpqrstvxzw';
function getPlural(irregulars, singular) {
function getPlural(wordsInfo, irregulars, singular) {
if (!singular) {

@@ -46,3 +46,6 @@ const err = new Error();

}
if (dontChange.indexOf(singular) > -1) {
if (wordsInfo && wordsInfo[singular] && wordsInfo[singular].plural) {
return wordsInfo[singular].plural;
}
else if (dontChange.indexOf(singular) > -1) {
return singular;

@@ -49,0 +52,0 @@ }

{
"name": "english-plurals",
"version": "0.8.9",
"version": "0.8.10",
"description": "English plural of words",

@@ -48,3 +48,3 @@ "main": "dist/index.js",

"devDependencies": {
"english-plurals-list": "0.8.9"
"english-plurals-list": "0.8.10"
},

@@ -58,3 +58,3 @@ "keywords": [

"license": "MIT",
"gitHead": "cad6ab45154f6680478ace7af2b4eb3b233f9392"
"gitHead": "c4be3bba693b9c5e1564b6da828850c26c7e030f"
}

@@ -14,2 +14,3 @@ # English plurals

`getPlural` returns the plural of a singular word, based on:
- a list of exception elements where singular is the key and having a `plural` property: in general leave null
- a list of irregular plurals: use `english-plurals-list`

@@ -16,0 +17,0 @@ - the singular word

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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