Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setDataAndSingle = function(currentData, data, type) {
currentData.svg = [];
for (var s = 0; s < data.svg.length; ++s) {
currentData.svg[s] = _.extend({}, data.svg[s], data.svg[s][type]);
delete currentData.svg[s].svg;
delete currentData.svg[s].png;
}
return currentData;
}
// If the sprite at least one SVG image
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'),