File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments