Updating NPM dependencies
This commit is contained in:
83
node_modules/locate-path/index.d.ts
generated
vendored
Normal file
83
node_modules/locate-path/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
declare namespace locatePath {
|
||||
interface Options {
|
||||
/**
|
||||
Current working directory.
|
||||
|
||||
@default process.cwd()
|
||||
*/
|
||||
readonly cwd?: string;
|
||||
|
||||
/**
|
||||
Type of path to match.
|
||||
|
||||
@default 'file'
|
||||
*/
|
||||
readonly type?: 'file' | 'directory';
|
||||
|
||||
/**
|
||||
Allow symbolic links to match if they point to the requested path type.
|
||||
|
||||
@default true
|
||||
*/
|
||||
readonly allowSymlinks?: boolean;
|
||||
}
|
||||
|
||||
interface AsyncOptions extends Options {
|
||||
/**
|
||||
Number of concurrently pending promises. Minimum: `1`.
|
||||
|
||||
@default Infinity
|
||||
*/
|
||||
readonly concurrency?: number;
|
||||
|
||||
/**
|
||||
Preserve `paths` order when searching.
|
||||
|
||||
Disable this to improve performance if you don't care about the order.
|
||||
|
||||
@default true
|
||||
*/
|
||||
readonly preserveOrder?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare const locatePath: {
|
||||
/**
|
||||
Get the first path that exists on disk of multiple paths.
|
||||
|
||||
@param paths - Paths to check.
|
||||
@returns The first path that exists or `undefined` if none exists.
|
||||
|
||||
@example
|
||||
```
|
||||
import 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'
|
||||
})();
|
||||
```
|
||||
*/
|
||||
(paths: Iterable<string>, options?: locatePath.AsyncOptions): Promise<
|
||||
string | undefined
|
||||
>;
|
||||
|
||||
/**
|
||||
Synchronously get the first path that exists on disk of multiple paths.
|
||||
|
||||
@param paths - Paths to check.
|
||||
@returns The first path that exists or `undefined` if none exists.
|
||||
*/
|
||||
sync(
|
||||
paths: Iterable<string>,
|
||||
options?: locatePath.Options
|
||||
): string | undefined;
|
||||
};
|
||||
|
||||
export = locatePath;
|
||||
67
node_modules/locate-path/index.js
generated
vendored
67
node_modules/locate-path/index.js
generated
vendored
@@ -1,24 +1,65 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const pathExists = require('path-exists');
|
||||
const fs = require('fs');
|
||||
const {promisify} = require('util');
|
||||
const pLocate = require('p-locate');
|
||||
|
||||
module.exports = (iterable, options) => {
|
||||
options = Object.assign({
|
||||
cwd: process.cwd()
|
||||
}, options);
|
||||
const fsStat = promisify(fs.stat);
|
||||
const fsLStat = promisify(fs.lstat);
|
||||
|
||||
return pLocate(iterable, el => pathExists(path.resolve(options.cwd, el)), options);
|
||||
const typeMappings = {
|
||||
directory: 'isDirectory',
|
||||
file: 'isFile'
|
||||
};
|
||||
|
||||
module.exports.sync = (iterable, options) => {
|
||||
options = Object.assign({
|
||||
cwd: process.cwd()
|
||||
}, options);
|
||||
function checkType({type}) {
|
||||
if (type in typeMappings) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const el of iterable) {
|
||||
if (pathExists.sync(path.resolve(options.cwd, el))) {
|
||||
return el;
|
||||
throw new Error(`Invalid type specified: ${type}`);
|
||||
}
|
||||
|
||||
const matchType = (type, stat) => type === undefined || stat[typeMappings[type]]();
|
||||
|
||||
module.exports = async (paths, options) => {
|
||||
options = {
|
||||
cwd: process.cwd(),
|
||||
type: 'file',
|
||||
allowSymlinks: true,
|
||||
...options
|
||||
};
|
||||
checkType(options);
|
||||
const statFn = options.allowSymlinks ? fsStat : fsLStat;
|
||||
|
||||
return pLocate(paths, async path_ => {
|
||||
try {
|
||||
const stat = await statFn(path.resolve(options.cwd, path_));
|
||||
return matchType(options.type, stat);
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
}, options);
|
||||
};
|
||||
|
||||
module.exports.sync = (paths, options) => {
|
||||
options = {
|
||||
cwd: process.cwd(),
|
||||
allowSymlinks: true,
|
||||
type: 'file',
|
||||
...options
|
||||
};
|
||||
checkType(options);
|
||||
const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync;
|
||||
|
||||
for (const path_ of paths) {
|
||||
try {
|
||||
const stat = statFn(path.resolve(options.cwd, path_));
|
||||
|
||||
if (matchType(options.type, stat)) {
|
||||
return path_;
|
||||
}
|
||||
} catch (_) {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
47
node_modules/locate-path/package.json
generated
vendored
47
node_modules/locate-path/package.json
generated
vendored
@@ -1,33 +1,27 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"locate-path@3.0.0",
|
||||
"/Users/drew.heavner/Documents/Github/upload-google-play"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "locate-path@3.0.0",
|
||||
"_id": "locate-path@3.0.0",
|
||||
"_from": "locate-path@^5.0.0",
|
||||
"_id": "locate-path@5.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
|
||||
"_integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
|
||||
"_location": "/locate-path",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "locate-path@3.0.0",
|
||||
"raw": "locate-path@^5.0.0",
|
||||
"name": "locate-path",
|
||||
"escapedName": "locate-path",
|
||||
"rawSpec": "3.0.0",
|
||||
"rawSpec": "^5.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.0.0"
|
||||
"fetchSpec": "^5.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/find-up"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
|
||||
"_spec": "3.0.0",
|
||||
"_where": "/Users/drew.heavner/Documents/Github/upload-google-play",
|
||||
"_resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
|
||||
"_shasum": "1afba396afd676a6d42504d0a67a3a7eb9f62aa0",
|
||||
"_spec": "locate-path@^5.0.0",
|
||||
"_where": "/home/codespace/workspace/upload-google-play/node_modules/find-up",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
@@ -36,20 +30,23 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/locate-path/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"p-locate": "^3.0.0",
|
||||
"path-exists": "^3.0.0"
|
||||
"p-locate": "^4.1.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Get the first path that exists on disk of multiple paths",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
"node": ">=8"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/locate-path#readme",
|
||||
"keywords": [
|
||||
@@ -74,7 +71,7 @@
|
||||
"url": "git+https://github.com/sindresorhus/locate-path.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"version": "3.0.0"
|
||||
"version": "5.0.0"
|
||||
}
|
||||
|
||||
35
node_modules/locate-path/readme.md
generated
vendored
35
node_modules/locate-path/readme.md
generated
vendored
@@ -32,11 +32,11 @@ const files = [
|
||||
|
||||
## API
|
||||
|
||||
### locatePath(input, [options])
|
||||
### locatePath(paths, [options])
|
||||
|
||||
Returns a `Promise` for the first path that exists or `undefined` if none exists.
|
||||
Returns a `Promise<string>` for the first path that exists or `undefined` if none exists.
|
||||
|
||||
#### input
|
||||
#### paths
|
||||
|
||||
Type: `Iterable<string>`
|
||||
|
||||
@@ -59,7 +59,7 @@ Number of concurrently pending promises.
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Preserve `input` order when searching.
|
||||
Preserve `paths` order when searching.
|
||||
|
||||
Disable this to improve performance if you don't care about the order.
|
||||
|
||||
@@ -70,11 +70,26 @@ Default: `process.cwd()`
|
||||
|
||||
Current working directory.
|
||||
|
||||
### locatePath.sync(input, [options])
|
||||
##### type
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `file`<br>
|
||||
Values: `file` `directory`
|
||||
|
||||
The type of paths that can match.
|
||||
|
||||
##### allowSymlinks
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Allow symbolic links to match if they point to the chosen path type.
|
||||
|
||||
### locatePath.sync(paths, [options])
|
||||
|
||||
Returns the first path that exists or `undefined` if none exists.
|
||||
|
||||
#### input
|
||||
#### paths
|
||||
|
||||
Type: `Iterable<string>`
|
||||
|
||||
@@ -88,6 +103,14 @@ Type: `Object`
|
||||
|
||||
Same as above.
|
||||
|
||||
##### type
|
||||
|
||||
Same as above.
|
||||
|
||||
##### allowSymlinks
|
||||
|
||||
Same as above.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
|
||||
Reference in New Issue
Block a user