is-promise
Test whether an object looks like a promises-a+ promise
Last updated 9 years ago by forbeslindesay .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install is-promise 
SYNC missed versions from official npm registry.

is-promise

Test whether an object looks like a promises-a+ promise

Build Status Dependency Status NPM version

Installation

$ npm install is-promise

You can also use it client side via npm.

API

import isPromise from 'is-promise';

isPromise(Promise.resolve());//=>true
isPromise({then:function () {...}});//=>true
isPromise(null);//=>false
isPromise({});//=>false
isPromise({then: true})//=>false

License

MIT

Current Tags

  • 4.0.0                                ...           latest (5 years ago)

9 Versions

  • 4.0.0                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 2.2.2                                ...           5 years ago
  • 2.2.1                                ...           5 years ago
  • 2.2.0                                ...           5 years ago
  • 2.1.0                                ...           9 years ago
  • 2.0.0                                ...           10 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           12 years ago

© 2010 - cnpmjs.org x YWFE | Home | YWFE