Skip to content

Commit

Permalink
Switched to ES5-friendly isPromiseLike helper.
Browse files Browse the repository at this point in the history
  • Loading branch information
radekmie committed Nov 16, 2023
1 parent a422b66 commit 78ffe3f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/blaze/materializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ var materializeDOMInner = function (htmljs, intoArray, parentView, workStack) {
throw new Error("Unexpected object in htmljs: " + htmljs);
};

const isPromiseLike = x => typeof x?.then === 'function';
const isPromiseLike = x => !!x && typeof x.then === 'function';

function waitForAllAttributesAndContinue(attrs, fn) {
const promises = [];
Expand Down
2 changes: 1 addition & 1 deletion packages/spacebars/spacebars-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Spacebars.call = function (value/*, args*/) {
}
};

const isPromiseLike = x => typeof x?.then === 'function';
const isPromiseLike = x => !!x && typeof x.then === 'function';

// Call this as `Spacebars.kw({ ... })`. The return value
// is `instanceof Spacebars.kw`.
Expand Down

0 comments on commit 78ffe3f

Please sign in to comment.