Skip to content

Commit 7d44670

Browse files
author
ehennum
committed
mjs as well as sjs #521
1 parent 65f2c0a commit 7d44670

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/marklogic.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,20 @@ ExtlibsWrapper.prototype.write = function writeExtlibsWrapper() {
191191
var module = args[0];
192192
var ext = mlutil.extension(module);
193193
if (ext === null) {
194-
throw new Error(module+' module for '+this.name+' library must have an extension of .sjs or .xqy');
194+
throw new Error(module+' module for '+this.name+' library must have an extension of .mjs, .sjs, or .xqy');
195195
}
196196
switch(ext) {
197197
case 'sjs':
198198
args[0] = 'application/javascript';
199199
break;
200+
case 'mjs':
201+
args[0] = 'application/vnd.marklogic-js-module';
202+
break;
200203
case 'xqy':
201204
args[0] = 'application/xquery';
202205
break;
203206
default:
204-
throw new Error(module+' module for '+this.name+' library does not have .sjs or .xqy extension');
207+
throw new Error(module+' module for '+this.name+' library does not have an .mjs, .sjs, or .xqy extension');
205208
}
206209
args.unshift(module);
207210
return this.extlibs.write.apply(this.extlibs, args);

lib/server-exec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ function serverXQueryEval() {
217217
* @param {string} path - the path of the module in the modules database
218218
* for the REST server; the module must have been installed previously
219219
* (typically with the {@link config.extlibs#write} function) using
220-
* a filename extension (sjs or xqy by default) registered for server
220+
* a filename extension (mjs, sjs, or xqy by default) registered for server
221221
* JavaScript or XQuery in the server mime types table
222222
* @param {object} [variables] - an object in which each property has
223223
* a variable name as a key and a number, string, or boolean value; the key

0 commit comments

Comments
 (0)