diff options
Diffstat (limited to 'node_modules/array-find-index')
| -rw-r--r-- | node_modules/array-find-index/index.js | 25 | ||||
| -rw-r--r-- | node_modules/array-find-index/license | 21 | ||||
| -rw-r--r-- | node_modules/array-find-index/package.json | 103 | ||||
| -rw-r--r-- | node_modules/array-find-index/readme.md | 30 | 
4 files changed, 179 insertions, 0 deletions
diff --git a/node_modules/array-find-index/index.js b/node_modules/array-find-index/index.js new file mode 100644 index 000000000..e2dcd9a09 --- /dev/null +++ b/node_modules/array-find-index/index.js @@ -0,0 +1,25 @@ +'use strict'; +module.exports = function (arr, predicate, ctx) { +	if (typeof Array.prototype.findIndex === 'function') { +		return arr.findIndex(predicate, ctx); +	} + +	if (typeof predicate !== 'function') { +		throw new TypeError('predicate must be a function'); +	} + +	var list = Object(arr); +	var len = list.length; + +	if (len === 0) { +		return -1; +	} + +	for (var i = 0; i < len; i++) { +		if (predicate.call(ctx, list[i], i, list)) { +			return i; +		} +	} + +	return -1; +}; diff --git a/node_modules/array-find-index/license b/node_modules/array-find-index/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/array-find-index/license @@ -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. diff --git a/node_modules/array-find-index/package.json b/node_modules/array-find-index/package.json new file mode 100644 index 000000000..02055ce20 --- /dev/null +++ b/node_modules/array-find-index/package.json @@ -0,0 +1,103 @@ +{ +  "_args": [ +    [ +      { +        "raw": "array-find-index@^1.0.1", +        "scope": null, +        "escapedName": "array-find-index", +        "name": "array-find-index", +        "rawSpec": "^1.0.1", +        "spec": ">=1.0.1 <2.0.0", +        "type": "range" +      }, +      "/home/dold/repos/taler/wallet-webex/node_modules/currently-unhandled" +    ] +  ], +  "_from": "array-find-index@>=1.0.1 <2.0.0", +  "_id": "array-find-index@1.0.2", +  "_inCache": true, +  "_location": "/array-find-index", +  "_nodeVersion": "4.5.0", +  "_npmOperationalInternal": { +    "host": "packages-12-west.internal.npmjs.com", +    "tmp": "tmp/array-find-index-1.0.2.tgz_1475224789159_0.7274378235451877" +  }, +  "_npmUser": { +    "name": "sindresorhus", +    "email": "sindresorhus@gmail.com" +  }, +  "_npmVersion": "2.15.9", +  "_phantomChildren": {}, +  "_requested": { +    "raw": "array-find-index@^1.0.1", +    "scope": null, +    "escapedName": "array-find-index", +    "name": "array-find-index", +    "rawSpec": "^1.0.1", +    "spec": ">=1.0.1 <2.0.0", +    "type": "range" +  }, +  "_requiredBy": [ +    "/currently-unhandled" +  ], +  "_resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", +  "_shasum": "df010aa1287e164bbda6f9723b0a96a1ec4187a1", +  "_shrinkwrap": null, +  "_spec": "array-find-index@^1.0.1", +  "_where": "/home/dold/repos/taler/wallet-webex/node_modules/currently-unhandled", +  "author": { +    "name": "Sindre Sorhus", +    "email": "sindresorhus@gmail.com", +    "url": "sindresorhus.com" +  }, +  "bugs": { +    "url": "https://github.com/sindresorhus/array-find-index/issues" +  }, +  "dependencies": {}, +  "description": "ES2015 `Array#findIndex()` ponyfill", +  "devDependencies": { +    "ava": "*", +    "xo": "*" +  }, +  "directories": {}, +  "dist": { +    "shasum": "df010aa1287e164bbda6f9723b0a96a1ec4187a1", +    "tarball": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz" +  }, +  "engines": { +    "node": ">=0.10.0" +  }, +  "files": [ +    "index.js" +  ], +  "gitHead": "983f4c827ad22fa0353182b1ddcbfaecd4412859", +  "homepage": "https://github.com/sindresorhus/array-find-index#readme", +  "keywords": [ +    "es2015", +    "ponyfill", +    "polyfill", +    "shim", +    "find", +    "index", +    "findindex", +    "array" +  ], +  "license": "MIT", +  "maintainers": [ +    { +      "name": "sindresorhus", +      "email": "sindresorhus@gmail.com" +    } +  ], +  "name": "array-find-index", +  "optionalDependencies": {}, +  "readme": "ERROR: No README data found!", +  "repository": { +    "type": "git", +    "url": "git+https://github.com/sindresorhus/array-find-index.git" +  }, +  "scripts": { +    "test": "xo && ava" +  }, +  "version": "1.0.2" +} diff --git a/node_modules/array-find-index/readme.md b/node_modules/array-find-index/readme.md new file mode 100644 index 000000000..31663411c --- /dev/null +++ b/node_modules/array-find-index/readme.md @@ -0,0 +1,30 @@ +# array-find-index [](https://travis-ci.org/sindresorhus/array-find-index) + +> ES2015 [`Array#findIndex()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) [ponyfill](https://ponyfill.com) + + +## Install + +``` +$ npm install --save array-find-index +``` + + +## Usage + +```js +const arrayFindIndex = require('array-find-index'); + +arrayFindIndex(['rainbow', 'unicorn', 'pony'], x => x === 'unicorn'); +//=> 1 +``` + + +## API + +Same as `Array#findIndex()`, but with the input array as the first argument. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com)  | 
