Skip to content

Commit c28d73b

Browse files
zekthphillipj
authored andcommitted
Make mustache.mjs work with Deno
Minor adjustments needed to make the TypeScript compiler that is built into Deno, be happy with how mustache.js' ES module source looks in terms of function parameters passed and object mutability. Refs phillipj#1
1 parent f25abbe commit c28d73b

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

mustache.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
44
typeof define === 'function' && define.amd ? define(factory) :
55
(global = global || self, global.Mustache = factory());
6-
}(this, function () { 'use strict';
6+
}(this, (function () { 'use strict';
77

88
/*!
99
* mustache.js - Logic-less {{mustache}} templates with JavaScript
@@ -527,7 +527,7 @@
527527
*/
528528
Writer.prototype.render = function render (template, view, partials, tags) {
529529
var tokens = this.parse(template, tags);
530-
var context = (view instanceof Context) ? view : new Context(view);
530+
var context = (view instanceof Context) ? view : new Context(view, undefined);
531531
return this.renderTokens(tokens, context, partials, template, tags);
532532
};
533533

@@ -652,7 +652,15 @@
652652
var mustache = {
653653
name: 'mustache.js',
654654
version: '3.1.0',
655-
tags: [ '{{', '}}' ]
655+
tags: [ '{{', '}}' ],
656+
clearCache: undefined,
657+
escape: undefined,
658+
parse: undefined,
659+
render: undefined,
660+
to_html: undefined,
661+
Scanner: undefined,
662+
Context: undefined,
663+
Writer: undefined
656664
};
657665

658666
// All high-level mustache.* functions use this writer.
@@ -715,4 +723,4 @@
715723

716724
return mustache;
717725

718-
}));
726+
})));

0 commit comments

Comments
 (0)