Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getCompiledResult : function(sources) {
sources = sources.join('\n');
var BEMHTML = require('bem-xjst/lib/bemhtml'),
exportName = this.getExportName(),
optimize = process.env[exportName + '_ENV'] !== 'development';
return BEMHTML.generate(sources, {
wrap : true,
exportName : exportName,
optimize : optimize,
cache : optimize && process.env[exportName + '_CACHE'] === 'on'
});
},
getCompiledResult: function (sources) {
sources = sources.join('\n');
var BEMHTML = require('bem-xjst/lib/bemhtml'),
exportName = this.getExportName(),
optimize = process.env[exportName + '_ENV'] !== 'development',
code = BEMHTML.generate(sources, {
wrap: false,
exportName: exportName,
optimize: optimize,
cache: optimize && process.env[exportName + '_CACHE'] === 'on'
});
var deps = this.getModulesDeps(),
modulesDeps = deps ? ', ' + JSON.stringify(Object.keys(deps)) : '',
modulesProvidedDeps = deps ? ', ' + Object.keys(deps).map(function (module) {
var providedName = deps[module];
return providedName === true ? module : providedName;
}).join(', ') : '';
return '(function(g) {\n' +
' var __bem_xjst = function(exports' + modulesProvidedDeps + ') {\n' +
' ' + code + ';\n' +