Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (this.result.data.svg.length) {
// Run through all configured rendering types
for (var type in this._options.render) {
var render = SVGSprite.renderConfig(this._options.outputDir, this._options.render[type], type, __dirname);
// If both a template and a destination file are given: Create tasks for it
if (render.dest !== null) {
if (this._options.verbose > 0) {
console.log('Creating the "%s" output type ...', type);
}
// Non-stylesheet output types: Simple rendering
if (['html', 'inline.svg'].indexOf(type) >= 0) {
tasks[type] = SVGSprite.renderTask(render.template, dest + '.' + type, _.extend({}, data), this.result);
// Stylesheet output type: Render variants
} else {
++this.output;
var data = setDataAndSingle(_.extend({}, this.result.data), this.result.data, 'svg'),
dest = path.join(path.dirname(render.dest), path.basename(render.dest, '.' + type));
// Render the SVG sprite version
tasks[type + '-svg-sprite'] = SVGSprite.renderTask(render.template, dest + '-svg-sprite.' + type, _.extend({}, data, {encode: !this.result.data.exceed.svg}), this.result);
// Render the SVG data version
tasks[type + '-svg-data'] = SVGSprite.renderTask(render.template, dest + '-svg-data.' + type, _.extend({}, data, {sprite: null, common: null, encode: !this.result.data.exceed.svg}), this.result);
// Render the single SVG icon version (if applicable)
if (this._options.keep) {
tasks[type + '-svg-single'] = SVGSprite.renderTask(render.template, dest + '-svg-single.' + type, _.extend({}, data, {sprite: null, common: null, encode: false}), this.result);