Template Upload
This commit is contained in:
16
node_modules/listify/.npmignore
generated
vendored
Normal file
16
node_modules/listify/.npmignore
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
lib-cov
|
||||
*.seed
|
||||
*.log
|
||||
*.csv
|
||||
*.dat
|
||||
*.out
|
||||
*.pid
|
||||
*.gz
|
||||
|
||||
pids
|
||||
logs
|
||||
results
|
||||
|
||||
npm-debug.log
|
||||
node_modules/
|
||||
|
18
node_modules/listify/.travis.yml
generated
vendored
Normal file
18
node_modules/listify/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.11"
|
||||
- "0.10"
|
||||
- "0.9"
|
||||
- "0.8"
|
||||
- "0.6"
|
||||
- "0.4"
|
||||
before_install:
|
||||
- '[ "${TRAVIS_NODE_VERSION}" == "0.6" ] || npm install -g npm@~1.4.6'
|
||||
matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- node_js: "0.11"
|
||||
- node_js: "0.9"
|
||||
- node_js: "0.6"
|
||||
- node_js: "0.4"
|
||||
|
20
node_modules/listify/LICENSE
generated
vendored
Normal file
20
node_modules/listify/LICENSE
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013 Jordan Harband
|
||||
|
||||
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.
|
32
node_modules/listify/README.md
generated
vendored
Normal file
32
node_modules/listify/README.md
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
#listify <sup>[![Version Badge][2]][1]</sup>
|
||||
|
||||
[![Build Status][3]][4] [![dependency status][5]][6] [![dev dependency status][7]][8]
|
||||
|
||||
Turn an array into a list of comma-separated values, appropriate for use in an English sentence.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var listify = require('listify');
|
||||
|
||||
assert(listify([1, 2]) === '1 and 2');
|
||||
assert(listify([1, 2, 3]) === '1, 2, and 3');
|
||||
assert(listify([1, 2, 3, 4]) === '1, 2, 3, and 4');
|
||||
assert(listify([1, 2, 3], { separator: '… ' }) === '1… 2… and 3');
|
||||
assert(listify([1, 2, 3], { finalWord: false }) === '1, 2, 3');
|
||||
assert(listify([1, 2, 3], { separator: '… ', finalWord: 'or' }) === '1… 2… or 3');
|
||||
```
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[1]: https://npmjs.org/package/listify
|
||||
[2]: http://vb.teelaun.ch/ljharb/listify.svg
|
||||
[3]: https://travis-ci.org/ljharb/listify.png
|
||||
[4]: https://travis-ci.org/ljharb/listify
|
||||
[5]: https://david-dm.org/ljharb/listify.png
|
||||
[6]: https://david-dm.org/ljharb/listify
|
||||
[7]: https://david-dm.org/ljharb/listify/dev-status.png
|
||||
[8]: https://david-dm.org/ljharb/listify#info=devDependencies
|
||||
|
||||
|
33
node_modules/listify/index.js
generated
vendored
Normal file
33
node_modules/listify/index.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/*jslint node: true */
|
||||
|
||||
var listify = function listify(list) {
|
||||
"use strict";
|
||||
|
||||
if (!Array.isArray(list)) {
|
||||
throw new TypeError('requires an array');
|
||||
}
|
||||
|
||||
var options = arguments.length > 1 ? arguments[1] : null;
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
var separator = options.hasOwnProperty('separator') ? options.separator : ', ';
|
||||
var finalWord = options.hasOwnProperty('finalWord') ? options.finalWord : 'and';
|
||||
if (finalWord.length > 0) {
|
||||
finalWord += ' ';
|
||||
}
|
||||
|
||||
var trimmed = list.filter(function (item) { return String(item).trim(); });
|
||||
var str;
|
||||
if (trimmed.length === 2 && finalWord.length > 0) {
|
||||
str = trimmed.join(' ' + finalWord);
|
||||
} else if (trimmed.length < 3) {
|
||||
str = trimmed.join(separator);
|
||||
} else {
|
||||
str = trimmed.slice(0, -1).concat(finalWord + trimmed[trimmed.length - 1]).join(separator);
|
||||
}
|
||||
return str;
|
||||
};
|
||||
|
||||
module.exports = listify;
|
||||
|
86
node_modules/listify/package.json
generated
vendored
Normal file
86
node_modules/listify/package.json
generated
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"listify@^1.0.0",
|
||||
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\typings"
|
||||
]
|
||||
],
|
||||
"_from": "listify@>=1.0.0-0 <2.0.0-0",
|
||||
"_id": "listify@1.0.0",
|
||||
"_inCache": true,
|
||||
"_location": "/listify",
|
||||
"_npmUser": {
|
||||
"email": "ljharb@gmail.com",
|
||||
"name": "ljharb"
|
||||
},
|
||||
"_npmVersion": "1.4.21",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "listify",
|
||||
"raw": "listify@^1.0.0",
|
||||
"rawSpec": "^1.0.0",
|
||||
"scope": null,
|
||||
"spec": ">=1.0.0-0 <2.0.0-0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/typings"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/listify/-/listify-1.0.0.tgz",
|
||||
"_shasum": "03ca7ba2d150d4267773f74e57558d1053d2bee3",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "listify@^1.0.0",
|
||||
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\typings",
|
||||
"author": {
|
||||
"name": "Jordan Harband"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ljharb/listify/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Turn an array into a list of comma-separated values, appropriate for use in an English sentence.",
|
||||
"devDependencies": {
|
||||
"covert": "~1.0.0",
|
||||
"tape": "~2.14.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "03ca7ba2d150d4267773f74e57558d1053d2bee3",
|
||||
"tarball": "https://registry.npmjs.org/listify/-/listify-1.0.0.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"gitHead": "1c7ddcc72ea3aadfae8d4b0d0c50cf8bb7df07a9",
|
||||
"homepage": "https://github.com/ljharb/listify",
|
||||
"installable": true,
|
||||
"keywords": [
|
||||
"array",
|
||||
"comma",
|
||||
"comma-separated",
|
||||
"csv",
|
||||
"list",
|
||||
"listify",
|
||||
"oxford comma"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "ljharb",
|
||||
"email": "ljharb@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "listify",
|
||||
"optionalDependencies": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ljharb/listify"
|
||||
},
|
||||
"scripts": {
|
||||
"coverage": "covert test.js",
|
||||
"coverage-quiet": "covert test.js --quiet",
|
||||
"test": "node test.js"
|
||||
},
|
||||
"version": "1.0.0"
|
||||
}
|
53
node_modules/listify/test.js
generated
vendored
Normal file
53
node_modules/listify/test.js
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
/*jslint node: true */
|
||||
"use strict";
|
||||
|
||||
var test = require('tape');
|
||||
var listify = require('./index');
|
||||
|
||||
test('throws when not given an array', function (t) {
|
||||
t.throws(function () { listify(); }, TypeError, 'requires an array');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('listifies 0 items', function (t) {
|
||||
t.equal(listify([]), '', 'empty list gives empty string');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('listifies 1 item', function (t) {
|
||||
t.equal(listify([1]), '1', 'one item is just toStringed');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('listifies 2 items', function (t) {
|
||||
t.equal(listify([1, 2]), '1 and 2', 'two items gives no separator');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('listifies 2 items, supports no finalWord', function (t) {
|
||||
t.equal(listify([1, 2], { finalWord: false }), '1, 2', 'two items, no final word, gives only separator');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('listifies 3 items', function (t) {
|
||||
t.equal(listify([1, 2, 3]), '1, 2, and 3', 'listifies three items');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('supports separator', function (t) {
|
||||
t.equal(listify([1, 2, 3], { separator: '… ' }), '1… 2… and 3', 'listifies with separator');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('supports finalWord', function (t) {
|
||||
t.equal(listify([1, 2, 3], { finalWord: 'or' }), '1, 2, or 3', 'listifies with no finalWord');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('stringifies separator and finalWord', function (t) {
|
||||
var sep = { toString: function () { return 'foo'; } };
|
||||
var word = { toString: function () { return 'bar'; } };
|
||||
t.equal(listify([1, 2, 3], { separator: sep, finalWord: word }), '1foo2foobar3', 'stringifies options');
|
||||
t.end();
|
||||
});
|
||||
|
Reference in New Issue
Block a user