summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/libnpmconfig/node_modules/locate-path
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/libnpmconfig/node_modules/locate-path')
-rw-r--r--deps/npm/node_modules/libnpmconfig/node_modules/locate-path/index.js24
-rw-r--r--deps/npm/node_modules/libnpmconfig/node_modules/locate-path/license9
-rw-r--r--deps/npm/node_modules/libnpmconfig/node_modules/locate-path/package.json76
-rw-r--r--deps/npm/node_modules/libnpmconfig/node_modules/locate-path/readme.md99
4 files changed, 208 insertions, 0 deletions
diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/index.js b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/index.js
new file mode 100644
index 0000000000..5aae6ee4ad
--- /dev/null
+++ b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/index.js
@@ -0,0 +1,24 @@
+'use strict';
+const path = require('path');
+const pathExists = require('path-exists');
+const pLocate = require('p-locate');
+
+module.exports = (iterable, options) => {
+ options = Object.assign({
+ cwd: process.cwd()
+ }, options);
+
+ return pLocate(iterable, el => pathExists(path.resolve(options.cwd, el)), options);
+};
+
+module.exports.sync = (iterable, options) => {
+ options = Object.assign({
+ cwd: process.cwd()
+ }, options);
+
+ for (const el of iterable) {
+ if (pathExists.sync(path.resolve(options.cwd, el))) {
+ return el;
+ }
+ }
+};
diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/license b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/license
new file mode 100644
index 0000000000..e7af2f7710
--- /dev/null
+++ b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/license
@@ -0,0 +1,9 @@
+MIT License
+
+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/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/package.json b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/package.json
new file mode 100644
index 0000000000..54600c0c48
--- /dev/null
+++ b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/package.json
@@ -0,0 +1,76 @@
+{
+ "_from": "locate-path@^3.0.0",
+ "_id": "locate-path@3.0.0",
+ "_inBundle": false,
+ "_integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
+ "_location": "/libnpmconfig/locate-path",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "locate-path@^3.0.0",
+ "name": "locate-path",
+ "escapedName": "locate-path",
+ "rawSpec": "^3.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^3.0.0"
+ },
+ "_requiredBy": [
+ "/libnpmconfig/find-up"
+ ],
+ "_resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
+ "_shasum": "dbec3b3ab759758071b58fe59fc41871af21400e",
+ "_spec": "locate-path@^3.0.0",
+ "_where": "/Users/zkat/Documents/code/work/npm/node_modules/libnpmconfig/node_modules/find-up",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/locate-path/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "p-locate": "^3.0.0",
+ "path-exists": "^3.0.0"
+ },
+ "deprecated": false,
+ "description": "Get the first path that exists on disk of multiple paths",
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/sindresorhus/locate-path#readme",
+ "keywords": [
+ "locate",
+ "path",
+ "paths",
+ "file",
+ "files",
+ "exists",
+ "find",
+ "finder",
+ "search",
+ "searcher",
+ "array",
+ "iterable",
+ "iterator"
+ ],
+ "license": "MIT",
+ "name": "locate-path",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/locate-path.git"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "version": "3.0.0"
+}
diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/readme.md b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/readme.md
new file mode 100644
index 0000000000..a1d2e62832
--- /dev/null
+++ b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/readme.md
@@ -0,0 +1,99 @@
+# locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path)
+
+> Get the first path that exists on disk of multiple paths
+
+
+## Install
+
+```
+$ npm install locate-path
+```
+
+
+## Usage
+
+Here we find the first file that exists on disk, in array order.
+
+```js
+const locatePath = require('locate-path');
+
+const files = [
+ 'unicorn.png',
+ 'rainbow.png', // Only this one actually exists on disk
+ 'pony.png'
+];
+
+(async () => {
+ console(await locatePath(files));
+ //=> 'rainbow'
+})();
+```
+
+
+## API
+
+### locatePath(input, [options])
+
+Returns a `Promise` for the first path that exists or `undefined` if none exists.
+
+#### input
+
+Type: `Iterable<string>`
+
+Paths to check.
+
+#### options
+
+Type: `Object`
+
+##### concurrency
+
+Type: `number`<br>
+Default: `Infinity`<br>
+Minimum: `1`
+
+Number of concurrently pending promises.
+
+##### preserveOrder
+
+Type: `boolean`<br>
+Default: `true`
+
+Preserve `input` order when searching.
+
+Disable this to improve performance if you don't care about the order.
+
+##### cwd
+
+Type: `string`<br>
+Default: `process.cwd()`
+
+Current working directory.
+
+### locatePath.sync(input, [options])
+
+Returns the first path that exists or `undefined` if none exists.
+
+#### input
+
+Type: `Iterable<string>`
+
+Paths to check.
+
+#### options
+
+Type: `Object`
+
+##### cwd
+
+Same as above.
+
+
+## Related
+
+- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)