You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
easy-markdown-editor/node_modules/gulp-concat/node_modules/gulp-util/lib/template.js

22 lines
621 B
JavaScript

var template = require('lodash.template');
var reEscape = require('lodash._reescape');
var reEvaluate = require('lodash._reevaluate');
var reInterpolate = require('lodash._reinterpolate');
var forcedSettings = {
escape: reEscape,
evaluate: reEvaluate,
interpolate: reInterpolate
};
module.exports = function(tmpl, data){
var fn = template(tmpl, forcedSettings);
var wrapped = function(o) {
if (typeof o === 'undefined' || typeof o.file === 'undefined') throw new Error('Failed to provide the current file as "file" to the template');
return fn(o);
};
return (data ? wrapped(data) : wrapped);
};