Sha256: ce85d0ad349eb57c865f98fda66427c0c76aae0c30e77b082ed384a244e5a72c

Contents?: true

Size: 621 Bytes

Versions: 3

Compression:

Stored size: 621 Bytes

Contents

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);
};

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gulp_assets-1.0.0.pre.5 template/node_modules/gulp-util/lib/template.js
gulp_assets-1.0.0.pre.4 template/node_modules/gulp-util/lib/template.js
gulp_assets-1.0.0.pre.3 template/node_modules/gulp-util/lib/template.js