aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type')
-rw-r--r--deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/index.js26
-rw-r--r--deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/license21
-rw-r--r--deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify/index.js68
-rw-r--r--deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify/license21
-rw-r--r--deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify/package.json80
-rw-r--r--deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify/readme.md119
-rw-r--r--deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/package.json45
-rw-r--r--deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/readme.md42
8 files changed, 422 insertions, 0 deletions
diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/index.js
new file mode 100644
index 0000000000..4ac9dd9679
--- /dev/null
+++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/index.js
@@ -0,0 +1,26 @@
+'use strict';
+const fs = require('fs');
+const pify = require('pify');
+
+function type(fn, fn2, fp) {
+ if (typeof fp !== 'string') {
+ return Promise.reject(new TypeError(`Expected a string, got ${typeof fp}`));
+ }
+
+ return pify(fs[fn])(fp).then(stats => stats[fn2]());
+}
+
+function typeSync(fn, fn2, fp) {
+ if (typeof fp !== 'string') {
+ throw new TypeError(`Expected a string, got ${typeof fp}`);
+ }
+
+ return fs[fn](fp)[fn2]();
+}
+
+exports.file = type.bind(null, 'stat', 'isFile');
+exports.dir = type.bind(null, 'stat', 'isDirectory');
+exports.symlink = type.bind(null, 'lstat', 'isSymbolicLink');
+exports.fileSync = typeSync.bind(null, 'statSync', 'isFile');
+exports.dirSync = typeSync.bind(null, 'statSync', 'isDirectory');
+exports.symlinkSync = typeSync.bind(null, 'lstatSync', 'isSymbolicLink');
diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/license b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/license
new file mode 100644
index 0000000000..654d0bfe94
--- /dev/null
+++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/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/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify/index.js
new file mode 100644
index 0000000000..7c720ebee8
--- /dev/null
+++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify/index.js
@@ -0,0 +1,68 @@
+'use strict';
+
+var processFn = function (fn, P, opts) {
+ return function () {
+ var that = this;
+ var args = new Array(arguments.length);
+
+ for (var i = 0; i < arguments.length; i++) {
+ args[i] = arguments[i];
+ }
+
+ return new P(function (resolve, reject) {
+ args.push(function (err, result) {
+ if (err) {
+ reject(err);
+ } else if (opts.multiArgs) {
+ var results = new Array(arguments.length - 1);
+
+ for (var i = 1; i < arguments.length; i++) {
+ results[i - 1] = arguments[i];
+ }
+
+ resolve(results);
+ } else {
+ resolve(result);
+ }
+ });
+
+ fn.apply(that, args);
+ });
+ };
+};
+
+var pify = module.exports = function (obj, P, opts) {
+ if (typeof P !== 'function') {
+ opts = P;
+ P = Promise;
+ }
+
+ opts = opts || {};
+ opts.exclude = opts.exclude || [/.+Sync$/];
+
+ var filter = function (key) {
+ var match = function (pattern) {
+ return typeof pattern === 'string' ? key === pattern : pattern.test(key);
+ };
+
+ return opts.include ? opts.include.some(match) : !opts.exclude.some(match);
+ };
+
+ var ret = typeof obj === 'function' ? function () {
+ if (opts.excludeMain) {
+ return obj.apply(this, arguments);
+ }
+
+ return processFn(obj, P, opts).apply(this, arguments);
+ } : {};
+
+ return Object.keys(obj).reduce(function (ret, key) {
+ var x = obj[key];
+
+ ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x;
+
+ return ret;
+ }, ret);
+};
+
+pify.all = pify;
diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify/license b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify/license
new file mode 100644
index 0000000000..654d0bfe94
--- /dev/null
+++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify/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/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify/package.json
new file mode 100644
index 0000000000..3c234828b3
--- /dev/null
+++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify/package.json
@@ -0,0 +1,80 @@
+{
+ "_from": "pify@^2.0.0",
+ "_id": "pify@2.3.0",
+ "_inBundle": false,
+ "_integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
+ "_location": "/libnpx/yargs/read-pkg-up/read-pkg/path-type/pify",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "pify@^2.0.0",
+ "name": "pify",
+ "escapedName": "pify",
+ "rawSpec": "^2.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^2.0.0"
+ },
+ "_requiredBy": [
+ "/libnpx/yargs/read-pkg-up/read-pkg/path-type"
+ ],
+ "_resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+ "_shasum": "ed141a6ac043a849ea588498e7dca8b15330e90c",
+ "_spec": "pify@^2.0.0",
+ "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/pify/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Promisify a callback-style function",
+ "devDependencies": {
+ "ava": "*",
+ "pinkie-promise": "^1.0.0",
+ "v8-natives": "0.0.2",
+ "xo": "*"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/sindresorhus/pify#readme",
+ "keywords": [
+ "promise",
+ "promises",
+ "promisify",
+ "denodify",
+ "denodeify",
+ "callback",
+ "cb",
+ "node",
+ "then",
+ "thenify",
+ "convert",
+ "transform",
+ "wrap",
+ "wrapper",
+ "bind",
+ "to",
+ "async",
+ "es2015"
+ ],
+ "license": "MIT",
+ "name": "pify",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/pify.git"
+ },
+ "scripts": {
+ "optimization-test": "node --allow-natives-syntax optimization-test.js",
+ "test": "xo && ava && npm run optimization-test"
+ },
+ "version": "2.3.0"
+}
diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify/readme.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify/readme.md
new file mode 100644
index 0000000000..97aeeb628b
--- /dev/null
+++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/node_modules/pify/readme.md
@@ -0,0 +1,119 @@
+# pify [![Build Status](https://travis-ci.org/sindresorhus/pify.svg?branch=master)](https://travis-ci.org/sindresorhus/pify)
+
+> Promisify a callback-style function
+
+
+## Install
+
+```
+$ npm install --save pify
+```
+
+
+## Usage
+
+```js
+const fs = require('fs');
+const pify = require('pify');
+
+// promisify a single function
+
+pify(fs.readFile)('package.json', 'utf8').then(data => {
+ console.log(JSON.parse(data).name);
+ //=> 'pify'
+});
+
+// or promisify all methods in a module
+
+pify(fs).readFile('package.json', 'utf8').then(data => {
+ console.log(JSON.parse(data).name);
+ //=> 'pify'
+});
+```
+
+
+## API
+
+### pify(input, [promiseModule], [options])
+
+Returns a promise wrapped version of the supplied function or module.
+
+#### input
+
+Type: `function`, `object`
+
+Callback-style function or module whose methods you want to promisify.
+
+#### promiseModule
+
+Type: `function`
+
+Custom promise module to use instead of the native one.
+
+Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill.
+
+#### options
+
+##### multiArgs
+
+Type: `boolean`
+Default: `false`
+
+By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument.
+
+```js
+const request = require('request');
+const pify = require('pify');
+
+pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => {
+ const [httpResponse, body] = result;
+});
+```
+
+##### include
+
+Type: `array` of (`string`|`regex`)
+
+Methods in a module to promisify. Remaining methods will be left untouched.
+
+##### exclude
+
+Type: `array` of (`string`|`regex`)
+Default: `[/.+Sync$/]`
+
+Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default.
+
+##### excludeMain
+
+Type: `boolean`
+Default: `false`
+
+By default, if given module is a function itself, this function will be promisified. Turn this option on if you want to promisify only methods of the module.
+
+```js
+const pify = require('pify');
+
+function fn() {
+ return true;
+}
+
+fn.method = (data, callback) => {
+ setImmediate(() => {
+ callback(data, null);
+ });
+};
+
+// promisify methods but not fn()
+const promiseFn = pify(fn, {excludeMain: true});
+
+if (promiseFn()) {
+ promiseFn.method('hi').then(data => {
+ console.log(data);
+ });
+}
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/package.json
new file mode 100644
index 0000000000..4aa3ee1c79
--- /dev/null
+++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/package.json
@@ -0,0 +1,45 @@
+{
+ "_from": "path-type@^2.0.0",
+ "_id": "path-type@2.0.0",
+ "_inBundle": false,
+ "_integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=",
+ "_location": "/libnpx/yargs/read-pkg-up/read-pkg/path-type",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "path-type@^2.0.0",
+ "name": "path-type",
+ "escapedName": "path-type",
+ "rawSpec": "^2.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^2.0.0"
+ },
+ "_requiredBy": [
+ "/libnpx/yargs/read-pkg-up/read-pkg"
+ ],
+ "_resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz",
+ "_shasum": "f012ccb8415b7096fc2daa1054c3d72389594c73",
+ "_shrinkwrap": null,
+ "_spec": "path-type@^2.0.0",
+ "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg",
+ "bin": null,
+ "bundleDependencies": false,
+ "dependencies": {
+ "pify": "^2.0.0"
+ },
+ "deprecated": false,
+ "description": "> Check if a path is a file, directory, or symlink",
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "name": "path-type",
+ "optionalDependencies": {},
+ "peerDependencies": {},
+ "scripts": {},
+ "version": "2.0.0"
+}
diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/readme.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/readme.md
new file mode 100644
index 0000000000..b1ea61fe92
--- /dev/null
+++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/path-type/readme.md
@@ -0,0 +1,42 @@
+# path-type [![Build Status](https://travis-ci.org/sindresorhus/path-type.svg?branch=master)](https://travis-ci.org/sindresorhus/path-type)
+
+> Check if a path is a file, directory, or symlink
+
+
+## Install
+
+```
+$ npm install --save path-type
+```
+
+
+## Usage
+
+```js
+const pathType = require('path-type');
+
+pathType.file('package.json').then(isFile => {
+ console.log(isFile);
+ //=> true
+})
+```
+
+
+## API
+
+### .file(path)
+### .dir(path)
+### .symlink(path)
+
+Returns a `Promise` for a `boolean` of whether the path is the checked type.
+
+### .fileSync(path)
+### .dirSync(path)
+### .symlinkSync(path)
+
+Returns a `boolean` of whether the path is the checked type.
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)