Skip to content

Commit 4bda6e4

Browse files
committed
Added cloud funciton argument
1 parent 522abdf commit 4bda6e4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ function ParseServer(args) {
5151
}
5252
if (args.cloud) {
5353
addParseCloud();
54-
require(args.cloud);
54+
if (typeof args.cloud === 'function') {
55+
args.cloud(Parse)
56+
} else if (typeof args.cloud === 'string') {
57+
require(args.cloud);
58+
} else {
59+
throw "argument 'cloud' must either be a string or a function";
60+
}
61+
5562
}
5663

5764
cache.apps[args.appId] = {

0 commit comments

Comments
 (0)