added unit testing, and started implementing unit tests...phew
This commit is contained in:
13
node_modules/p-is-promise/index.d.ts
generated
vendored
Normal file
13
node_modules/p-is-promise/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Check if `input` is a ES2015 promise.
|
||||
*
|
||||
* @param input - Value to be checked.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* import isPromise from 'p-is-promise';
|
||||
*
|
||||
* isPromise(Promise.resolve('🦄'));
|
||||
* //=> true
|
||||
*/
|
||||
export default function(input: unknown): input is Promise<unknown>;
|
14
node_modules/p-is-promise/index.js
generated
vendored
Normal file
14
node_modules/p-is-promise/index.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
const isPromise = input => (
|
||||
input instanceof Promise ||
|
||||
(
|
||||
input !== null &&
|
||||
typeof input === 'object' &&
|
||||
typeof input.then === 'function' &&
|
||||
typeof input.catch === 'function'
|
||||
)
|
||||
);
|
||||
|
||||
module.exports = isPromise;
|
||||
module.exports.default = isPromise;
|
9
node_modules/p-is-promise/license
generated
vendored
Normal file
9
node_modules/p-is-promise/license
generated
vendored
Normal file
@ -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.
|
74
node_modules/p-is-promise/package.json
generated
vendored
Normal file
74
node_modules/p-is-promise/package.json
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
{
|
||||
"_from": "p-is-promise@^2.0.0",
|
||||
"_id": "p-is-promise@2.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==",
|
||||
"_location": "/p-is-promise",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "p-is-promise@^2.0.0",
|
||||
"name": "p-is-promise",
|
||||
"escapedName": "p-is-promise",
|
||||
"rawSpec": "^2.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^2.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/mem"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz",
|
||||
"_shasum": "7554e3d572109a87e1f3f53f6a7d85d1b194f4c5",
|
||||
"_spec": "p-is-promise@^2.0.0",
|
||||
"_where": "/Users/josh.burman/Projects/braid/node_modules/mem",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/p-is-promise/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Check if something is a promise",
|
||||
"devDependencies": {
|
||||
"ava": "^0.25.0",
|
||||
"bluebird": "^3.4.6",
|
||||
"tsd-check": "^0.2.1",
|
||||
"xo": "^0.23.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/p-is-promise#readme",
|
||||
"keywords": [
|
||||
"promise",
|
||||
"is",
|
||||
"detect",
|
||||
"check",
|
||||
"kind",
|
||||
"type",
|
||||
"thenable",
|
||||
"es2015",
|
||||
"async",
|
||||
"await",
|
||||
"promises",
|
||||
"bluebird"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "p-is-promise",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/p-is-promise.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd-check"
|
||||
},
|
||||
"version": "2.0.0"
|
||||
}
|
43
node_modules/p-is-promise/readme.md
generated
vendored
Normal file
43
node_modules/p-is-promise/readme.md
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
# p-is-promise [](https://travis-ci.org/sindresorhus/p-is-promise)
|
||||
|
||||
> Check if something is a promise
|
||||
|
||||
Why not [`is-promise`](https://github.com/then/is-promise)? That module [checks for a thenable](https://github.com/then/is-promise/issues/6), not an ES2015 promise. This one is stricter.
|
||||
|
||||
You most likely don't need this. Just pass your value to `Promise.resolve()` and let it handle it.
|
||||
|
||||
Can be useful if you need to create a fast path for a synchronous operation.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install p-is-promise
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const pIsPromise = require('p-is-promise');
|
||||
const Bluebird = require('bluebird');
|
||||
|
||||
pIsPromise(Promise.resolve('🦄'));
|
||||
//=> true
|
||||
|
||||
pIsPromise(Bluebird.resolve('🦄'));
|
||||
//=> true
|
||||
|
||||
pIsPromise('🦄');
|
||||
//=> false
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [More…](https://github.com/sindresorhus/promise-fun)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
Reference in New Issue
Block a user