Upgrade Ava to v4
This commit is contained in:
parent
9a40cc5274
commit
ce89f1b611
1153 changed files with 27264 additions and 95308 deletions
19
node_modules/plur/index.d.ts
generated
vendored
19
node_modules/plur/index.d.ts
generated
vendored
|
|
@ -1,23 +1,26 @@
|
|||
/**
|
||||
Pluralize a word.
|
||||
|
||||
@param word - Word to pluralize.
|
||||
@param plural - Pluralized word.
|
||||
@param word - The word to pluralize.
|
||||
@param plural - Explicitly provide the pluralized word.
|
||||
The plural suffix will match the case of the last letter in the word.
|
||||
This option is only for extreme edge-cases. You probably won't need it.
|
||||
|
||||
Default:
|
||||
|
||||
- Irregular nouns will use this [list](https://github.com/sindresorhus/irregular-plurals/blob/master/irregular-plurals.json).
|
||||
- Irregular nouns will use this [list](https://github.com/sindresorhus/irregular-plurals/blob/main/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*).
|
||||
|
||||
@param count - Count to determine whether to use singular or plural.
|
||||
@param count - The count to determine whether to use singular or plural.
|
||||
|
||||
@example
|
||||
```
|
||||
import plur = require('plur');
|
||||
import plur from 'plur';
|
||||
|
||||
plur('rainbow');
|
||||
//=> 'rainbows'
|
||||
|
||||
plur('unicorn', 4);
|
||||
//=> 'unicorns'
|
||||
|
|
@ -32,7 +35,5 @@ plur('cactus', 2);
|
|||
//=> 'cacti'
|
||||
```
|
||||
*/
|
||||
declare function plur(word: string, count: number): string;
|
||||
declare function plur(word: string, plural: string, count: number): string;
|
||||
|
||||
export = plur;
|
||||
export default function plur(word: string, count?: number): string;
|
||||
export default function plur(word: string, plural: string, count: number): string;
|
||||
|
|
|
|||
9
node_modules/plur/index.js
generated
vendored
9
node_modules/plur/index.js
generated
vendored
|
|
@ -1,7 +1,6 @@
|
|||
'use strict';
|
||||
const irregularPlurals = require('irregular-plurals');
|
||||
import irregularPlurals from 'irregular-plurals';
|
||||
|
||||
module.exports = (word, plural, count) => {
|
||||
export default function plur(word, plural, count) {
|
||||
if (typeof plural === 'number') {
|
||||
count = plural;
|
||||
}
|
||||
|
|
@ -12,7 +11,7 @@ module.exports = (word, plural, count) => {
|
|||
const firstLetter = word.charAt(0);
|
||||
const isFirstLetterUpperCase = firstLetter === firstLetter.toUpperCase();
|
||||
if (isFirstLetterUpperCase) {
|
||||
plural = firstLetter.toUpperCase() + plural.slice(1);
|
||||
plural = firstLetter + plural.slice(1);
|
||||
}
|
||||
|
||||
const isWholeWordUpperCase = word === word.toUpperCase();
|
||||
|
|
@ -28,4 +27,4 @@ module.exports = (word, plural, count) => {
|
|||
}
|
||||
|
||||
return Math.abs(count) === 1 ? word : plural;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
14
node_modules/plur/package.json
generated
vendored
14
node_modules/plur/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "plur",
|
||||
"version": "4.0.0",
|
||||
"version": "5.1.0",
|
||||
"description": "Pluralize a word",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/plur",
|
||||
|
|
@ -10,8 +10,10 @@
|
|||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": "./index.js",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
|
|
@ -33,11 +35,11 @@
|
|||
"nouns"
|
||||
],
|
||||
"dependencies": {
|
||||
"irregular-plurals": "^3.2.0"
|
||||
"irregular-plurals": "^3.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.11.0",
|
||||
"xo": "^0.26.1"
|
||||
"ava": "^3.15.0",
|
||||
"tsd": "^0.18.0",
|
||||
"xo": "^0.46.4"
|
||||
}
|
||||
}
|
||||
21
node_modules/plur/readme.md
generated
vendored
21
node_modules/plur/readme.md
generated
vendored
|
|
@ -1,17 +1,20 @@
|
|||
# plur [](https://travis-ci.org/sindresorhus/plur)
|
||||
# plur
|
||||
|
||||
> Pluralize a word
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install plur
|
||||
```sh
|
||||
npm install plur
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const plur = require('plur');
|
||||
import plur from 'plur';
|
||||
|
||||
plur('rainbow');
|
||||
//=> 'rainbows'
|
||||
|
||||
plur('unicorn', 4);
|
||||
//=> 'unicorns'
|
||||
|
|
@ -28,25 +31,25 @@ plur('cactus', 2);
|
|||
|
||||
## API
|
||||
|
||||
### plur(word, plural?, count)
|
||||
### plur(word, plural?, count?)
|
||||
|
||||
#### word
|
||||
|
||||
Type: `string`
|
||||
|
||||
Word to pluralize.
|
||||
The word to pluralize.
|
||||
|
||||
#### plural
|
||||
|
||||
Type: `string`\
|
||||
Default:
|
||||
|
||||
- Irregular nouns will use this [list](https://github.com/sindresorhus/irregular-plurals/blob/master/irregular-plurals.json).
|
||||
- Irregular nouns will use this [list](https://github.com/sindresorhus/irregular-plurals/blob/main/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.
|
||||
Explicitly provide the pluralized word.
|
||||
|
||||
The plural suffix will match the case of the last letter in the word.
|
||||
|
||||
|
|
@ -56,4 +59,4 @@ This option is only for extreme edge-cases. You probably won't need it.
|
|||
|
||||
Type: `number`
|
||||
|
||||
Count to determine whether to use singular or plural.
|
||||
The count to determine whether to use singular or plural. If omitted, defaults to plural.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue