Initial commit
This commit is contained in:
1
node_modules/array-filter/.npmignore
generated
vendored
Normal file
1
node_modules/array-filter/.npmignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
4
node_modules/array-filter/.travis.yml
generated
vendored
Normal file
4
node_modules/array-filter/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.8"
|
||||
- "0.10"
|
||||
67
node_modules/array-filter/README.md
generated
vendored
Normal file
67
node_modules/array-filter/README.md
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
|
||||
# array-filter
|
||||
|
||||
`Array#filter` for older browsers.
|
||||
|
||||
[](http://travis-ci.org/juliangruber/array-filter)
|
||||
[](https://www.npmjs.org/package/array-filter)
|
||||
|
||||
[](https://ci.testling.com/juliangruber/array-filter)
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var filter = require('array-filter');
|
||||
|
||||
var array = [1, 2, 3];
|
||||
console.log(filter(array, function (el, i, arr) {
|
||||
return false; // I throw it on the ground!
|
||||
}));
|
||||
// => []
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### filter(arr, fn[, self])
|
||||
|
||||
Return an array with elements of `arr` for which `fn` returns a truthy value. `fn` is called with
|
||||
|
||||
* `el`: The current element
|
||||
* `i`: The element's index
|
||||
* `arr`: The whole array
|
||||
|
||||
Optionally pass in `self` as the `this` value for `fn`.
|
||||
|
||||
## Installation
|
||||
|
||||
With [npm](http://npmjs.org) do
|
||||
|
||||
```bash
|
||||
$ npm install array-filter
|
||||
```
|
||||
|
||||
Then bundle for the browser with [browserify](https://github.com/substack/browserify).
|
||||
|
||||
## License
|
||||
|
||||
(MIT)
|
||||
|
||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.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.
|
||||
25
node_modules/array-filter/index.js
generated
vendored
Normal file
25
node_modules/array-filter/index.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
/**
|
||||
* Array#filter.
|
||||
*
|
||||
* @param {Array} arr
|
||||
* @param {Function} fn
|
||||
* @param {Object=} self
|
||||
* @return {Array}
|
||||
* @throw TypeError
|
||||
*/
|
||||
|
||||
module.exports = function (arr, fn, self) {
|
||||
if (arr.filter) return arr.filter(fn, self);
|
||||
if (void 0 === arr || null === arr) throw new TypeError;
|
||||
if ('function' != typeof fn) throw new TypeError;
|
||||
var ret = [];
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
if (!hasOwn.call(arr, i)) continue;
|
||||
var val = arr[i];
|
||||
if (fn.call(self, val, i, arr)) ret.push(val);
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
var hasOwn = Object.prototype.hasOwnProperty;
|
||||
78
node_modules/array-filter/package.json
generated
vendored
Normal file
78
node_modules/array-filter/package.json
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"array-filter@1.0.0",
|
||||
"C:\\Users\\anelissen.DOMAINE\\Development\\tools\\node\\cbor"
|
||||
]
|
||||
],
|
||||
"_from": "array-filter@1.0.0",
|
||||
"_id": "array-filter@1.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=",
|
||||
"_location": "/array-filter",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "array-filter@1.0.0",
|
||||
"name": "array-filter",
|
||||
"escapedName": "array-filter",
|
||||
"rawSpec": "1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/available-typed-arrays"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz",
|
||||
"_spec": "1.0.0",
|
||||
"_where": "C:\\Users\\anelissen.DOMAINE\\Development\\tools\\node\\cbor",
|
||||
"author": {
|
||||
"name": "Julian Gruber",
|
||||
"email": "mail@juliangruber.com",
|
||||
"url": "http://juliangruber.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/juliangruber/array-filter/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Array#filter for older browsers.",
|
||||
"devDependencies": {
|
||||
"tape": "~2.3.2"
|
||||
},
|
||||
"homepage": "https://github.com/juliangruber/array-filter",
|
||||
"keywords": [
|
||||
"array",
|
||||
"filter",
|
||||
"browser",
|
||||
"html",
|
||||
"browserify"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "array-filter",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/juliangruber/array-filter.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape test/*.js"
|
||||
},
|
||||
"testling": {
|
||||
"files": "test/*.js",
|
||||
"browsers": [
|
||||
"ie/8..latest",
|
||||
"firefox/17..latest",
|
||||
"firefox/nightly",
|
||||
"chrome/22..latest",
|
||||
"chrome/canary",
|
||||
"opera/12..latest",
|
||||
"opera/next",
|
||||
"safari/5.1..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2..latest"
|
||||
]
|
||||
},
|
||||
"version": "1.0.0"
|
||||
}
|
||||
12
node_modules/array-filter/test/filter.js
generated
vendored
Normal file
12
node_modules/array-filter/test/filter.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
var filter = require('..');
|
||||
var test = require('tape');
|
||||
|
||||
test('filter', function(t) {
|
||||
var arr = [1, 2, 3, 4, 5];
|
||||
arr.filter = undefined;
|
||||
var even = filter(arr, function(el) {
|
||||
return el % 2 == 0;
|
||||
});
|
||||
t.deepEqual(even, [2, 4]);
|
||||
t.end();
|
||||
});
|
||||
12
node_modules/array-filter/test/holes.js
generated
vendored
Normal file
12
node_modules/array-filter/test/holes.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
var filter = require('..');
|
||||
var test = require('tape');
|
||||
|
||||
test('skip over holes', function(t) {
|
||||
var arr = new Array(5);
|
||||
arr.filter = undefined;
|
||||
var res = filter(arr, function(el) {
|
||||
return false;
|
||||
});
|
||||
t.deepEqual(res, []);
|
||||
t.end();
|
||||
});
|
||||
13
node_modules/array-filter/test/modify.js
generated
vendored
Normal file
13
node_modules/array-filter/test/modify.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
var filter = require('..');
|
||||
var test = require('tape');
|
||||
|
||||
test('modify', function(t) {
|
||||
var arr = ['foo'];
|
||||
arr.filter = undefined;
|
||||
var mod = filter(arr, function(el, i, arr) {
|
||||
arr[i] = 'bar';
|
||||
return true;
|
||||
});
|
||||
t.deepEqual(mod, ['foo']);
|
||||
t.end();
|
||||
});
|
||||
12
node_modules/array-filter/test/self.js
generated
vendored
Normal file
12
node_modules/array-filter/test/self.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
var filter = require('..');
|
||||
var test = require('tape');
|
||||
|
||||
test('self', function(t) {
|
||||
var arr = [1];
|
||||
arr.filter = undefined;
|
||||
var self = {};
|
||||
filter(arr, function(el) {
|
||||
t.equal(this, self);
|
||||
t.end();
|
||||
}, self);
|
||||
});
|
||||
21
node_modules/array-filter/test/this-arg.js
generated
vendored
Normal file
21
node_modules/array-filter/test/this-arg.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
var filter = require('..');
|
||||
var test = require('tape');
|
||||
|
||||
test('thisArg', function(t) {
|
||||
var self = {};
|
||||
var arr = [1];
|
||||
arr.filter = undefined;
|
||||
filter(arr, function(el) {
|
||||
t.equal(this, self);
|
||||
t.end();
|
||||
}, self);
|
||||
});
|
||||
|
||||
test('thisArg native', function(t) {
|
||||
var self = {};
|
||||
var arr = [1];
|
||||
filter(arr, function(el) {
|
||||
t.equal(this, self);
|
||||
t.end();
|
||||
}, self);
|
||||
});
|
||||
21
node_modules/array-filter/test/typecheck.js
generated
vendored
Normal file
21
node_modules/array-filter/test/typecheck.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
var filter = require('..');
|
||||
var test = require('tape');
|
||||
|
||||
test('typecheck', function(t) {
|
||||
var arr = [];
|
||||
arr.filter = undefined;
|
||||
|
||||
t.throws(function() {
|
||||
filter(undefined, function(){});
|
||||
}, 'arr undefined');
|
||||
|
||||
t.throws(function() {
|
||||
filter(null, function(){});
|
||||
}, 'arr null');
|
||||
|
||||
t.throws(function() {
|
||||
filter(arr, {});
|
||||
}, 'fn wrong type');
|
||||
|
||||
t.end();
|
||||
});
|
||||
Reference in New Issue
Block a user