editor-js / editor-js/image

Wrong checking of Promise in isPromise

Open
#135 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
285
Forks
307
PR merge metrics
No merged PRs in 30d

Description

The function isPromise should not check if object is a Promise by `Promise.resolve(object) === object`. Instead it should check for `.then()` method.

https://github.com/editor-js/image/blob/e26b3e7c106486d2d776219e18cd125469991a25/src/uploader.js#L185-L187

This way custom uploader cannot be used when using for example patched Promises in ZoneJS.

Details explained here: https://stackoverflow.com/questions/27746304/how-do-i-tell-if-an-object-is-a-promise

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.