Skip to content

Commit

Permalink
Merge pull request #136 from SmallhillCZ/patch-1
Browse files Browse the repository at this point in the history
Correct way of checking if object is a Promise
  • Loading branch information
robonetphy authored Aug 21, 2021
2 parents e26b3e7 + 6d3244f commit e3df500
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@editorjs/image",
"version": "2.6.0",
"version": "2.6.1",
"keywords": [
"codex editor",
"tool",
Expand Down
2 changes: 1 addition & 1 deletion src/uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,5 @@ export default class Uploader {
* @returns {boolean}
*/
function isPromise(object) {
return Promise.resolve(object) === object;
return object && typeof object.then === "function";
}

0 comments on commit e3df500

Please sign in to comment.