Skip to content
This repository was archived by the owner on Dec 10, 2019. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/engine_mustache.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
var Mustache = require('mustache');
var utilMustache = require('./util_mustache');

// This holds the config from from core. The core has to call
// usePatternLabConfig() at load time for this to be populated, which
// it does, so we're cool, right?
let patternLabConfig = {};

var engine_mustache = {
engine: Mustache,
engineName: 'mustache',
Expand Down Expand Up @@ -111,6 +116,16 @@ var engine_mustache = {
foundPatternPartial = foundPatternPartial.split(':')[0];

return foundPatternPartial;
},

/**
* Accept a Pattern Lab config object from the core and put it in
* this module's closure scope so we can configure engine behavior.
*
* @param {object} config - the global config object from core
*/
usePatternLabConfig: function (config) {
patternLabConfig = config;
}
};

Expand Down