pax_global_header00006660000000000000000000000064134637707140014526gustar00rootroot0000000000000052 comment=90d8a9993c7f4c9ba6849f17a71e22eeef40cb13 irregular-plurals-3.1.0/000077500000000000000000000000001346377071400152035ustar00rootroot00000000000000irregular-plurals-3.1.0/.editorconfig000066400000000000000000000002571346377071400176640ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.yml] indent_style = space indent_size = 2 irregular-plurals-3.1.0/.gitattributes000066400000000000000000000000231346377071400200710ustar00rootroot00000000000000* text=auto eol=lf irregular-plurals-3.1.0/.gitignore000066400000000000000000000000271346377071400171720ustar00rootroot00000000000000node_modules yarn.lock irregular-plurals-3.1.0/.npmrc000066400000000000000000000000231346377071400163160ustar00rootroot00000000000000package-lock=false irregular-plurals-3.1.0/.travis.yml000066400000000000000000000000651346377071400173150ustar00rootroot00000000000000language: node_js node_js: - '12' - '10' - '8' irregular-plurals-3.1.0/index.d.ts000066400000000000000000000002741346377071400171070ustar00rootroot00000000000000import irregularPluralsJson = require('./irregular-plurals.json'); declare const irregularPlurals: ReadonlyMap< keyof typeof irregularPluralsJson, string >; export = irregularPlurals; irregular-plurals-3.1.0/index.js000066400000000000000000000003501346377071400166460ustar00rootroot00000000000000'use strict'; const irregularPlurals = require('./irregular-plurals.json'); // Ensure nobody can modify each others Map Object.defineProperty(module, 'exports', { get() { return new Map(Object.entries(irregularPlurals)); } }); irregular-plurals-3.1.0/index.test-d.ts000066400000000000000000000003451346377071400200630ustar00rootroot00000000000000import {expectType} from 'tsd'; import irregularPluralsJson = require('./irregular-plurals.json'); import irregularPlurals = require('.'); expectType>( irregularPlurals ); irregular-plurals-3.1.0/irregular-plurals.json000066400000000000000000000060711346377071400215560ustar00rootroot00000000000000{ "addendum": "addenda", "aircraft": "aircraft", "alga": "algae", "alumna": "alumnae", "alumnus": "alumni", "amoeba": "amoebae", "analysis": "analyses", "antenna": "antennae", "antithesis": "antitheses", "apex": "apices", "appendix": "appendices", "automaton": "automata", "axis": "axes", "bacillus": "bacilli", "bacterium": "bacteria", "barracks": "barracks", "basis": "bases", "beau": "beaux", "bison": "bison", "buffalo": "buffalo", "bureau": "bureaus", "cactus": "cacti", "calf": "calves", "carp": "carp", "census": "censuses", "chassis": "chassis", "cherub": "cherubim", "child": "children", "château": "châteaus", "cod": "cod", "codex": "codices", "concerto": "concerti", "corpus": "corpora", "crisis": "crises", "criterion": "criteria", "curriculum": "curricula", "datum": "data", "deer": "deer", "diagnosis": "diagnoses", "die": "dice", "dwarf": "dwarfs", "echo": "echoes", "elf": "elves", "elk": "elk", "ellipsis": "ellipses", "embargo": "embargoes", "emphasis": "emphases", "erratum": "errata", "faux pas": "faux pas", "fez": "fezes", "firmware": "firmware", "fish": "fish", "focus": "foci", "foot": "feet", "formula": "formulae", "fungus": "fungi", "gallows": "gallows", "genus": "genera", "goose": "geese", "graffito": "graffiti", "grouse": "grouse", "half": "halves", "hero": "heroes", "hoof": "hooves", "hovercraft": "hovercraft", "hypothesis": "hypotheses", "index": "indices", "kakapo": "kakapo", "knife": "knives", "larva": "larvae", "leaf": "leaves", "libretto": "libretti", "life": "lives", "loaf": "loaves", "locus": "loci", "louse": "lice", "man": "men", "matrix": "matrices", "means": "means", "medium": "media", "memorandum": "memoranda", "millennium": "millennia", "minutia": "minutiae", "moose": "moose", "mouse": "mice", "nebula": "nebulae", "nemesis": "nemeses", "neurosis": "neuroses", "news": "news", "nucleus": "nuclei", "oasis": "oases", "offspring": "offspring", "opus": "opera", "ovum": "ova", "ox": "oxen", "paralysis": "paralyses", "parenthesis": "parentheses", "person": "people", "phenomenon": "phenomena", "phylum": "phyla", "pike": "pike", "polyhedron": "polyhedra", "potato": "potatoes", "prognosis": "prognoses", "quiz": "quizzes", "radius": "radii", "referendum": "referenda", "salmon": "salmon", "scarf": "scarves", "self": "selves", "series": "series", "sheep": "sheep", "shelf": "shelves", "shrimp": "shrimp", "spacecraft": "spacecraft", "species": "species", "spectrum": "spectra", "squid": "squid", "stimulus": "stimuli", "stratum": "strata", "swine": "swine", "syllabus": "syllabi", "symposium": "symposia", "synopsis": "synopses", "synthesis": "syntheses", "tableau": "tableaus", "that": "those", "thesis": "theses", "thief": "thieves", "this": "these", "tomato": "tomatoes", "tooth": "teeth", "trout": "trout", "tuna": "tuna", "vertebra": "vertebrae", "vertex": "vertices", "veto": "vetoes", "vita": "vitae", "vortex": "vortices", "watercraft": "watercraft", "wharf": "wharves", "wife": "wives", "wolf": "wolves", "woman": "women" } irregular-plurals-3.1.0/license000066400000000000000000000021251346377071400165500ustar00rootroot00000000000000MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. irregular-plurals-3.1.0/package.json000066400000000000000000000013431346377071400174720ustar00rootroot00000000000000{ "name": "irregular-plurals", "version": "3.1.0", "description": "Map of nouns to their irregular plural form", "license": "MIT", "repository": "sindresorhus/irregular-plurals", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.js", "index.d.ts", "irregular-plurals.json" ], "keywords": [ "word", "words", "list", "map", "hash", "json", "irregular", "plural", "plurals", "noun", "nouns" ], "devDependencies": { "ava": "^1.4.1", "tsd": "^0.7.2", "xo": "^0.24.0" }, "tsd": { "compilerOptions": { "resolveJsonModule": true } } } irregular-plurals-3.1.0/readme.md000066400000000000000000000020341346377071400167610ustar00rootroot00000000000000# irregular-plurals [![Build Status](https://travis-ci.org/sindresorhus/irregular-plurals.svg?branch=master)](https://travis-ci.org/sindresorhus/irregular-plurals) > Map of nouns to their irregular plural form > An irregular plural in this library is defined as a noun that cannot be made plural by applying these rules: > - If the noun ends in an "s", "x", "z", "ch" or "sh", add "es" > - If the noun ends in a "y" and is preceded by a consonant, drop the "y" and add "ies" > - If the noun ends in a "y" and is preceded by a vowel, add "s" The list is just a [JSON file](irregular-plurals.json) and can be used anywhere. ## Install ``` $ npm install irregular-plurals ``` ## Usage ```js const irregularPlurals = require('irregular-plurals'); console.log(irregularPlurals.get('cactus')); //=> 'cacti' console.log(irregularPlurals); /* Map { [addendum, 'addenda'], [alga, 'algae'], … } */ ``` ## Related - [plur](https://github.com/sindresorhus/plur) - Pluralize a word ## License MIT © [Sindre Sorhus](https://sindresorhus.com) irregular-plurals-3.1.0/test.js000066400000000000000000000005751346377071400165270ustar00rootroot00000000000000import test from 'ava'; import irregularPlurals from '.'; test('main', t => { t.true(irregularPlurals.has('calf')); t.is(irregularPlurals.get('calf'), 'calves'); }); test('isolated', t => { const fresh1 = require('.'); const fresh2 = require('.'); fresh1.delete('calf'); t.false(fresh1.has('calf')); t.true(fresh2.has('calf')); t.true(irregularPlurals.has('calf')); });