Skip to content

Commit 09df565

Browse files
committed
Fix promises.compact function.
1 parent 55a3282 commit 09df565

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

js/jsonld.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,6 +1276,11 @@ jsonld.promises = function(options) {
12761276
throw new TypeError('Could not compact, too few arguments.');
12771277
}
12781278
var compact = function(input, ctx, options, callback) {
1279+
if(typeof options === 'function') {
1280+
callback = options;
1281+
options = {};
1282+
}
1283+
options = options || {};
12791284
// ensure only one value is returned in callback
12801285
jsonld.compact(input, ctx, options, function(err, compacted) {
12811286
callback(err, compacted);

0 commit comments

Comments
 (0)