From d37bbc36694b963b27c6d9f767493984c593780c Mon Sep 17 00:00:00 2001 From: Vincent LE GOFF Date: Sat, 12 Oct 2019 10:07:49 +0200 Subject: [PATCH] Update mustache.mjs --- mustache.mjs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/mustache.mjs b/mustache.mjs index 52d7123db..5429cdf04 100644 --- a/mustache.mjs +++ b/mustache.mjs @@ -3,8 +3,9 @@ * http://github.com/janl/mustache.js */ -import { version } from './package.json'; +import _package from './package.json'; +var version = _package.version; var objectToString = Object.prototype.toString; var isArray = Array.isArray || function isArrayPolyfill (object) { return objectToString.call(object) === '[object Array]'; @@ -522,7 +523,7 @@ Writer.prototype.parse = function parse (template, tags) { */ Writer.prototype.render = function render (template, view, partials, tags) { var tokens = this.parse(template, tags); - var context = (view instanceof Context) ? view : new Context(view); + var context = (view instanceof Context) ? view : new Context(view, undefined); return this.renderTokens(tokens, context, partials, template, tags); }; @@ -647,7 +648,15 @@ Writer.prototype.rawValue = function rawValue (token) { var mustache = { name: 'mustache.js', version: version, - tags: [ '{{', '}}' ] + tags: [ '{{', '}}' ], + clearCache: undefined, + escape: undefined, + parse: undefined, + render: undefined, + to_html: undefined, + Scanner: undefined, + Context: undefined, + Writer: undefined }; // All high-level mustache.* functions use this writer. @@ -708,4 +717,4 @@ mustache.Scanner = Scanner; mustache.Context = Context; mustache.Writer = Writer; -export default mustache; \ No newline at end of file +export default mustache;