update
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<a href="https://promisesaplus.com/"><img src="https://promisesaplus.com/assets/logo-small.png" align="right" /></a>
|
||||
|
||||
# is-promise
|
||||
|
||||
Test whether an object looks like a promises-a+ promise
|
||||
|
||||
[](https://travis-ci.org/then/is-promise)
|
||||
[](https://david-dm.org/then/is-promise)
|
||||
[](https://www.npmjs.org/package/is-promise)
|
||||
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
$ npm install is-promise
|
||||
|
||||
You can also use it client side via npm.
|
||||
|
||||
## API
|
||||
|
||||
```typescript
|
||||
import isPromise from 'is-promise';
|
||||
|
||||
isPromise(Promise.resolve());//=>true
|
||||
isPromise({then:function () {...}});//=>true
|
||||
isPromise(null);//=>false
|
||||
isPromise({});//=>false
|
||||
isPromise({then: true})//=>false
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
@@ -0,0 +1,13 @@
|
||||
Copyright (c) 2015, Wes Todd
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
Reference in New Issue
Block a user