Skip to content

Commit

Permalink
fix(toString): IE11 fix (TypeError: Invalid calling object)
Browse files Browse the repository at this point in the history
  • Loading branch information
Max V. Kovrigovich committed Feb 5, 2021
1 parent d9605a4 commit 1514cd6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/utils/is-function.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default function isFunction(value: unknown): value is Function {
return !!value
&& (
toString.call(value) === '[object Function]'
Object.prototype.toString.call(value) === '[object Function]'
|| typeof value === 'function'
)
}
2 changes: 1 addition & 1 deletion src/utils/is-promise.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default function isPromise<T = unknown>(value: unknown): value is PromiseLike<T> {
return !!value
&& (
toString.call(value) === '[object Promise]'
Object.prototype.toString.call(value) === '[object Promise]'
|| typeof value === 'function'
)
&& typeof (value as PromiseLike<unknown>).then === 'function'
Expand Down

0 comments on commit 1514cd6

Please sign in to comment.