p-is-promise

WebJar for p-is-promise

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

p-is-promise
Last Version

Last Version

2.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

p-is-promise
WebJar for p-is-promise
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/p-is-promise

Download p-is-promise

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/p-is-promise/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>p-is-promise</artifactId>
    <version>2.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/p-is-promise/
implementation 'org.webjars.npm:p-is-promise:2.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/p-is-promise/
implementation ("org.webjars.npm:p-is-promise:2.1.0")
'org.webjars.npm:p-is-promise:jar:2.1.0'
<dependency org="org.webjars.npm" name="p-is-promise" rev="2.1.0">
  <artifact name="p-is-promise" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='p-is-promise', version='2.1.0')
)
libraryDependencies += "org.webjars.npm" % "p-is-promise" % "2.1.0"
[org.webjars.npm/p-is-promise "2.1.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

p-is-promise

Check if something is a promise

Why not is-promise? That module checks for a thenable, 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

const pIsPromise = require('p-is-promise');
const Bluebird = require('bluebird');

pIsPromise(Promise.resolve('🦄'));
//=> true

pIsPromise(Bluebird.resolve('🦄'));
//=> true

pIsPromise('🦄');
//=> false

Related


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Versions

Version
2.1.0
2.0.0
1.1.0