@fibery/pluralize 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/pluralize.d.ts +19 -0
- package/{src/pluralize.ts → lib/src/pluralize.js} +231 -274
- package/package.json +8 -5
- package/.babelrc +0 -3
- package/.eslintignore +0 -2
- package/.eslintrc +0 -3
- package/CHANGELOG.md +0 -7
- package/src/pluralize.test.ts +0 -835
- package/tsconfig.build.json +0 -15
- package/tsconfig.json +0 -4
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pluralize or singularize a word based on the passed in count.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} word The word to pluralize
|
|
5
|
+
* @param {number} count How many of the word exist
|
|
6
|
+
* @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)
|
|
7
|
+
* @return {string}
|
|
8
|
+
*/
|
|
9
|
+
export declare function pluralize(word: string, count?: number, inclusive?: boolean): string;
|
|
10
|
+
export declare namespace pluralize {
|
|
11
|
+
var plural: (word: string) => string;
|
|
12
|
+
var isPlural: (word: string) => boolean;
|
|
13
|
+
var singular: (word: string) => string;
|
|
14
|
+
var isSingular: (word: string) => boolean;
|
|
15
|
+
var addPluralRule: (rule: string | RegExp, replacement: string) => void;
|
|
16
|
+
var addSingularRule: (rule: string | RegExp, replacement: string) => void;
|
|
17
|
+
var addUncountableRule: (word: string | RegExp) => void;
|
|
18
|
+
var addIrregularRule: (single: string, plural: string) => void;
|
|
19
|
+
}
|