change approach again
This commit is contained in:
2
node_modules/test-value/node_modules/array-back/.npmignore
generated
vendored
Normal file
2
node_modules/test-value/node_modules/array-back/.npmignore
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
tmp
|
||||
out
|
8
node_modules/test-value/node_modules/array-back/.travis.yml
generated
vendored
Normal file
8
node_modules/test-value/node_modules/array-back/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 7
|
||||
- 6
|
||||
- 5
|
||||
- 4
|
||||
- iojs
|
||||
- 0.12
|
21
node_modules/test-value/node_modules/array-back/LICENSE
generated
vendored
Normal file
21
node_modules/test-value/node_modules/array-back/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-16 Lloyd Brookes <75pound@gmail.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.
|
51
node_modules/test-value/node_modules/array-back/README.md
generated
vendored
Normal file
51
node_modules/test-value/node_modules/array-back/README.md
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
[](https://www.npmjs.org/package/array-back)
|
||||
[](https://www.npmjs.org/package/array-back)
|
||||
[](https://travis-ci.org/75lb/array-back)
|
||||
[](https://david-dm.org/75lb/array-back)
|
||||
[](https://github.com/feross/standard)
|
||||
|
||||
<a name="module_array-back"></a>
|
||||
|
||||
## array-back
|
||||
**Example**
|
||||
```js
|
||||
var arrayify = require("array-back")
|
||||
```
|
||||
<a name="exp_module_array-back--arrayify"></a>
|
||||
|
||||
### arrayify(input) ⇒ <code>Array</code> ⏏
|
||||
Takes any input and guarantees an array back.
|
||||
|
||||
- converts array-like objects (e.g. `arguments`) to a real array
|
||||
- converts `undefined` to an empty array
|
||||
- converts any another other, singular value (including `null`) into an array containing that value
|
||||
- ignores input which is already an array
|
||||
|
||||
**Kind**: Exported function
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| input | <code>\*</code> | the input value to convert to an array |
|
||||
|
||||
**Example**
|
||||
```js
|
||||
> a.arrayify(undefined)
|
||||
[]
|
||||
|
||||
> a.arrayify(null)
|
||||
[ null ]
|
||||
|
||||
> a.arrayify(0)
|
||||
[ 0 ]
|
||||
|
||||
> a.arrayify([ 1, 2 ])
|
||||
[ 1, 2 ]
|
||||
|
||||
> function f(){ return a.arrayify(arguments); }
|
||||
> f(1,2,3)
|
||||
[ 1, 2, 3 ]
|
||||
```
|
||||
|
||||
* * *
|
||||
|
||||
© 2015-16 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown).
|
11
node_modules/test-value/node_modules/array-back/jsdoc2md/README.hbs
generated
vendored
Normal file
11
node_modules/test-value/node_modules/array-back/jsdoc2md/README.hbs
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
[](https://www.npmjs.org/package/array-back)
|
||||
[](https://www.npmjs.org/package/array-back)
|
||||
[](https://travis-ci.org/75lb/array-back)
|
||||
[](https://david-dm.org/75lb/array-back)
|
||||
[](https://github.com/feross/standard)
|
||||
|
||||
{{>main}}
|
||||
|
||||
* * *
|
||||
|
||||
© 2015-16 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown).
|
47
node_modules/test-value/node_modules/array-back/lib/array-back.js
generated
vendored
Normal file
47
node_modules/test-value/node_modules/array-back/lib/array-back.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
'use strict'
|
||||
var t = require('typical')
|
||||
|
||||
/**
|
||||
* @module array-back
|
||||
* @example
|
||||
* var arrayify = require("array-back")
|
||||
*/
|
||||
module.exports = arrayify
|
||||
|
||||
/**
|
||||
* Takes any input and guarantees an array back.
|
||||
*
|
||||
* - converts array-like objects (e.g. `arguments`) to a real array
|
||||
* - converts `undefined` to an empty array
|
||||
* - converts any another other, singular value (including `null`) into an array containing that value
|
||||
* - ignores input which is already an array
|
||||
*
|
||||
* @param {*} - the input value to convert to an array
|
||||
* @returns {Array}
|
||||
* @alias module:array-back
|
||||
* @example
|
||||
* > a.arrayify(undefined)
|
||||
* []
|
||||
*
|
||||
* > a.arrayify(null)
|
||||
* [ null ]
|
||||
*
|
||||
* > a.arrayify(0)
|
||||
* [ 0 ]
|
||||
*
|
||||
* > a.arrayify([ 1, 2 ])
|
||||
* [ 1, 2 ]
|
||||
*
|
||||
* > function f(){ return a.arrayify(arguments); }
|
||||
* > f(1,2,3)
|
||||
* [ 1, 2, 3 ]
|
||||
*/
|
||||
function arrayify (input) {
|
||||
if (input === undefined) {
|
||||
return []
|
||||
} else if (t.isArrayLike(input)) {
|
||||
return Array.prototype.slice.call(input)
|
||||
} else {
|
||||
return Array.isArray(input) ? input : [ input ]
|
||||
}
|
||||
}
|
66
node_modules/test-value/node_modules/array-back/package.json
generated
vendored
Normal file
66
node_modules/test-value/node_modules/array-back/package.json
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
{
|
||||
"_from": "array-back@^1.0.3",
|
||||
"_id": "array-back@1.0.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs=",
|
||||
"_location": "/test-value/array-back",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "array-back@^1.0.3",
|
||||
"name": "array-back",
|
||||
"escapedName": "array-back",
|
||||
"rawSpec": "^1.0.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/test-value"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz",
|
||||
"_shasum": "644ba7f095f7ffcf7c43b5f0dc39d3c1f03c063b",
|
||||
"_spec": "array-back@^1.0.3",
|
||||
"_where": "/home/wn/workspace-node/homepage/node_modules/test-value",
|
||||
"author": {
|
||||
"name": "Lloyd Brookes",
|
||||
"email": "75pound@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/75lb/array-back/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"typical": "^2.6.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Guarantees an array back",
|
||||
"devDependencies": {
|
||||
"core-assert": "^0.2.1",
|
||||
"jsdoc-to-markdown": "^2.0.1",
|
||||
"test-runner": "^0.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.12.0"
|
||||
},
|
||||
"homepage": "https://github.com/75lb/array-back#readme",
|
||||
"keywords": [
|
||||
"to",
|
||||
"convert",
|
||||
"return",
|
||||
"array",
|
||||
"arrayify"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./lib/array-back.js",
|
||||
"name": "array-back",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/75lb/array-back.git"
|
||||
},
|
||||
"scripts": {
|
||||
"docs": "jsdoc2md -t jsdoc2md/README.hbs lib/*.js > README.md; echo",
|
||||
"test": "test-runner test/*.js"
|
||||
},
|
||||
"version": "1.0.4"
|
||||
}
|
18
node_modules/test-value/node_modules/array-back/test/test.js
generated
vendored
Normal file
18
node_modules/test-value/node_modules/array-back/test/test.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
'use strict'
|
||||
var TestRunner = require('test-runner')
|
||||
var arrayify = require('../')
|
||||
var a = require('core-assert')
|
||||
|
||||
var runner = new TestRunner()
|
||||
|
||||
runner.test('arrayify()', function () {
|
||||
a.deepStrictEqual(arrayify(undefined), [])
|
||||
a.deepStrictEqual(arrayify(null), [ null ])
|
||||
a.deepStrictEqual(arrayify(0), [ 0 ])
|
||||
a.deepStrictEqual(arrayify([ 1, 2 ]), [ 1, 2 ])
|
||||
|
||||
function func () {
|
||||
a.deepStrictEqual(arrayify(arguments), [ 1, 2, 3 ])
|
||||
}
|
||||
func(1, 2, 3)
|
||||
})
|
Reference in New Issue
Block a user