File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ var Promise = require('bluebird');
4
4
var lpad = require ( './util' ) . lpad ;
5
5
var Class = require ( './class' ) ;
6
6
7
+ function isPromise ( probe ) {
8
+
9
+ return probe instanceof Promise || ( probe && probe . then &&
10
+ probe . constructor && probe . constructor . name === 'Promise' ) ;
11
+ }
12
+
7
13
function formatPath ( dir , name ) {
8
14
return path . join ( dir , name ) ;
9
15
}
@@ -75,7 +81,7 @@ var Skeleton = Class.extend({
75
81
migration = require ( this . path ) . up . apply ( this , params ) ;
76
82
77
83
if ( migration === null ) migration = Promise . resolve ( ) ;
78
- if ( migration instanceof Promise ) {
84
+ if ( isPromise ( migration ) ) {
79
85
80
86
migration
81
87
. then ( function ( ) {
@@ -118,7 +124,7 @@ var Skeleton = Class.extend({
118
124
migration = require ( this . path ) . down . apply ( this , params ) ;
119
125
120
126
if ( migration === null ) migration = Promise . resolve ( ) ;
121
- if ( migration instanceof Promise ) {
127
+ if ( isPromise ( migration ) ) {
122
128
123
129
migration
124
130
. then ( function ( ) {
You can’t perform that action at this time.
0 commit comments