mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add new methods from pluralize v5.1.0 (#20683)
* Add isPlural / isSingular Test the changes to `index.d.ts`. * Add isPlural / isSingular See [release notes](https://github.com/blakeembrey/pluralize/releases), new API has been present since July.
This commit is contained in:
parent
c722838e01
commit
fadcd86546
16
types/pluralize/index.d.ts
vendored
16
types/pluralize/index.d.ts
vendored
@ -57,9 +57,23 @@ interface PluralizeStatic {
|
||||
* @param word
|
||||
*/
|
||||
addUncountableRule(word: string|RegExp): void;
|
||||
|
||||
/**
|
||||
* Test if provided word is plural.
|
||||
*
|
||||
* @param word
|
||||
*/
|
||||
isPlural(word: string): boolean;
|
||||
|
||||
/**
|
||||
* Test if provided word is singular.
|
||||
*
|
||||
* @param word
|
||||
*/
|
||||
isSingular(word: string): boolean;
|
||||
}
|
||||
|
||||
declare module "pluralize" {
|
||||
export = pluralize;
|
||||
}
|
||||
declare var pluralize: PluralizeStatic;
|
||||
declare var pluralize: PluralizeStatic;
|
||||
|
||||
@ -22,4 +22,10 @@ pluralize.plural('irregular'); //=> "regular"
|
||||
|
||||
pluralize.plural('paper'); //=> "papers"
|
||||
pluralize.addUncountableRule('paper');
|
||||
pluralize.plural('paper'); //=> "paper"
|
||||
pluralize.plural('paper'); //=> "paper"
|
||||
|
||||
pluralize.isPlural('test') //=> false
|
||||
pluralize.isSingular('test') //=> true
|
||||
|
||||
pluralize.isPlural('tests') //=> true
|
||||
pluralize.isSingular('tests') //=> false
|
||||
|
||||
Loading…
Reference in New Issue
Block a user