mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-13 05:13:33 -06:00
Initial commit
This commit is contained in:
20
node_modules/plur/index.js
generated
vendored
Normal file
20
node_modules/plur/index.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
var irregularPlurals = require('irregular-plurals');
|
||||
|
||||
module.exports = function (str, plural, count) {
|
||||
if (typeof plural === 'number') {
|
||||
count = plural;
|
||||
}
|
||||
|
||||
if (str in irregularPlurals) {
|
||||
plural = irregularPlurals[str];
|
||||
} else if (typeof plural !== 'string') {
|
||||
plural = (str.replace(/(?:s|x|z|ch|sh)$/i, '$&e').replace(/([^aeiou])y$/i, '$1ie') + 's')
|
||||
.replace(/i?e?s$/i, function (m) {
|
||||
var isTailLowerCase = str.slice(-1) === str.slice(-1).toLowerCase();
|
||||
return isTailLowerCase ? m.toLowerCase() : m.toUpperCase();
|
||||
});
|
||||
}
|
||||
|
||||
return count === 1 ? str : plural;
|
||||
};
|
21
node_modules/plur/license
generated
vendored
Normal file
21
node_modules/plur/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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.
|
98
node_modules/plur/package.json
generated
vendored
Normal file
98
node_modules/plur/package.json
generated
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"plur@^2.0.0",
|
||||
"/Users/pmarsceill/_projects/just-the-docs/node_modules/colorguard"
|
||||
]
|
||||
],
|
||||
"_from": "plur@>=2.0.0 <3.0.0",
|
||||
"_id": "plur@2.1.2",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/plur",
|
||||
"_nodeVersion": "4.2.1",
|
||||
"_npmUser": {
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"name": "sindresorhus"
|
||||
},
|
||||
"_npmVersion": "2.14.7",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "plur",
|
||||
"raw": "plur@^2.0.0",
|
||||
"rawSpec": "^2.0.0",
|
||||
"scope": null,
|
||||
"spec": ">=2.0.0 <3.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/colorguard",
|
||||
"/stylehacks"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/plur/-/plur-2.1.2.tgz",
|
||||
"_shasum": "7482452c1a0f508e3e344eaec312c91c29dc655a",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "plur@^2.0.0",
|
||||
"_where": "/Users/pmarsceill/_projects/just-the-docs/node_modules/colorguard",
|
||||
"author": {
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"name": "Sindre Sorhus",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/plur/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"irregular-plurals": "^1.0.0"
|
||||
},
|
||||
"description": "Pluralize a word",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "7482452c1a0f508e3e344eaec312c91c29dc655a",
|
||||
"tarball": "https://registry.npmjs.org/plur/-/plur-2.1.2.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "d896377c1ccd97ac612c491e4926176b5f92d8a6",
|
||||
"homepage": "https://github.com/sindresorhus/plur",
|
||||
"keywords": [
|
||||
"count",
|
||||
"irregular",
|
||||
"noun",
|
||||
"nouns",
|
||||
"plur",
|
||||
"plural",
|
||||
"pluralize",
|
||||
"plurals",
|
||||
"singular",
|
||||
"str",
|
||||
"string",
|
||||
"word"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "sindresorhus",
|
||||
"email": "sindresorhus@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "plur",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/plur.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "2.1.2"
|
||||
}
|
67
node_modules/plur/readme.md
generated
vendored
Normal file
67
node_modules/plur/readme.md
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
# plur [](https://travis-ci.org/sindresorhus/plur)
|
||||
|
||||
> Pluralize a word
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save plur
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const plur = require('plur');
|
||||
|
||||
plur('unicorn', 4);
|
||||
//=> 'unicorns'
|
||||
|
||||
plur('puppy', 2);
|
||||
//=> 'puppies'
|
||||
|
||||
plur('box', 2);
|
||||
//=> 'boxes'
|
||||
|
||||
plur('cactus', 2);
|
||||
//=> 'cacti'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### plur(word, [plural], count)
|
||||
|
||||
#### word
|
||||
|
||||
Type: `string`
|
||||
|
||||
Word to pluralize.
|
||||
|
||||
#### plural
|
||||
|
||||
Type: `string`
|
||||
Default:
|
||||
|
||||
- Irregular nouns will use this [list](https://github.com/sindresorhus/irregular-plurals/blob/master/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.
|
||||
|
||||
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.
|
||||
|
||||
#### count
|
||||
|
||||
Type: `number`
|
||||
|
||||
Count to determine whether to use singular or plural.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
Reference in New Issue
Block a user