File tree 2 files changed +16
-2
lines changed
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 28
28
"inherits" : " 2.0.3" ,
29
29
"is-arguments" : " ^1.0.4" ,
30
30
"is-generator-function" : " ^1.0.7" ,
31
- "is-promise" : " ^2.1.0" ,
32
31
"object.entries" : " ^1.1.0" ,
33
32
"safe-buffer" : " ^5.1.2"
34
33
},
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ var isBuffer = require('./isBuffer');
7
7
8
8
var isArgumentsObject = require ( 'is-arguments' ) ;
9
9
var isGeneratorFunction = require ( 'is-generator-function' ) ;
10
- var isPromise = require ( 'is-promise' ) ;
11
10
12
11
function uncurryThis ( f ) {
13
12
return f . call . bind ( f ) ;
@@ -59,6 +58,22 @@ exports.isArgumentsObject = isArgumentsObject;
59
58
60
59
exports . isGeneratorFunction = isGeneratorFunction ;
61
60
61
+ // Taken from here and modified for better browser support
62
+ // https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js
63
+ function isPromise ( input ) {
64
+ return (
65
+ (
66
+ typeof Promise !== 'undefined' &&
67
+ input instanceof Promise
68
+ ) ||
69
+ (
70
+ input !== null &&
71
+ typeof input === 'object' &&
72
+ typeof input . then === 'function' &&
73
+ typeof input . catch === 'function'
74
+ )
75
+ ) ;
76
+ }
62
77
exports . isPromise = isPromise ;
63
78
64
79
function isArrayBufferView ( value ) {
You can’t perform that action at this time.
0 commit comments