lib/svg-sprite.js
function SVGSprite(options) {

    options = _.extend({}, options);

    // Validate & prepare the options
    this._options = _.extend(defaultOptions, options);
    this._options.prefix = (new String(this._options.prefix || '').trim()) || null;
    this._options.common = (new String(this._options.common || '').trim()) || null;
    this._options.maxwidth = Math.abs(parseInt(this._options.maxwidth || 1000, 10));
    this._options.maxheight = Math.abs(parseInt(this._options.maxheight || 1000, 10));
    this._options.padding = Math.abs(parseInt(this._options.padding, 10));
    this._options.pseudo = (new String(this._options.pseudo).trim()) || '~';
    this._options.dims = !!this._options.dims;
    this._options.verbose = Math.min(Math.max(0, parseInt(this._options.verbose, 10)), 3);
    this._options.render = _.extend({css: true}, this._options.render);
    this._options.cleanwith = (new String(this._options.cleanwith || '').trim()) || null;
    this._options.cleanconfig = _.extend({}, this._options.cleanconfig || {});
    this.namespacePow = [];

    // Reset all internal stacks
    this._reset();

    var SVGO = require('svgo');
    this._options.cleanconfig.plugins = svgoDefaults.concat(this._options.cleanconfig.plugins || []);
    this._cleaner = new SVGO(this._options.cleanconfig);
    this._clean = this._cleanSVGO;
}
function SVGSprite(options) {

    options = _.extend({}, options);

    // Validate & prepare the options
    this._options = _.extend(defaultOptions, options);
    this._options.prefix = (new String(this._options.prefix || '').trim()) || null;
    this._options.common = (new String(this._options.common || '').trim()) || null;
    this._options.maxwidth = Math.abs(parseInt(this._options.maxwidth || 1000, 10));
    this._options.maxheight = Math.abs(parseInt(this._options.maxheight || 1000, 10));
    this._options.padding = Math.abs(parseInt(this._options.padding, 10));
    this._options.pseudo = (new String(this._options.pseudo).trim()) || '~';
    this._options.dims = !!this._options.dims;
    this._options.verbose = Math.min(Math.max(0, parseInt(this._options.verbose, 10)), 3);
    this._options.render = _.extend({css: true}, this._options.render);
    this._options.cleanwith = (new String(this._options.cleanwith || '').trim()) || null;
    this._options.cleanconfig = _.extend({}, this._options.cleanconfig || {});
    this.namespacePow = [];

    // Reset all internal stacks
    this._reset();

    var SVGO = require('svgo');
    this._options.cleanconfig.plugins = svgoDefaults.concat(this._options.cleanconfig.plugins || []);
    this._cleaner = new SVGO(this._options.cleanconfig);
    this._clean = this._cleanSVGO;
}
function SVGSprite ( options ) { options = _ . extend ( { } , options ) ; // Validate & prepare the options this . _options = _ . extend ( defaultOptions , options ) ; this . _options . prefix = ( new String ( this . _options . prefix || '' ) . trim ( ) ) || null ; this . _options . common = ( new String ( this . _options . common || '' ) . trim ( ) ) || null ; this . _options . maxwidth = Math . abs ( parseInt ( this . _options . maxwidth || 1000 , 10 ) ) ; this . _options . maxheight = Math . abs ( parseInt ( this . _options . maxheight || 1000 , 10 ) ) ; this . _options . padding = Math . abs ( parseInt ( this . _options . padding , 10 ) ) ; this . _options . pseudo = ( new String ( this . _options . pseudo ) . trim ( ) ) || '~' ; this . _options . dims = ! ! this . _options . dims ; this . _options . verbose = Math . min ( Math . max ( 0 , parseInt ( this . _options . verbose , 10 ) ) , 3 ) ; this . _options . render = _ . extend ( { css : true } , this . _options . render ) ; this . _options . cleanwith = ( new String ( this . _options . cleanwith || '' ) . trim ( ) ) || null ; this . _options . cleanconfig = _ . extend ( { } , this . _options . cleanconfig || { } ) ; this . namespacePow = [ ] ; // Reset all internal stacks this . _reset ( ) ; var SVGO = require ( 'svgo' ) ; this . _options . cleanconfig . plugins = svgoDefaults . concat ( this . _options . cleanconfig . plugins || [ ] ) ; this . _cleaner = new SVGO ( this . _options . cleanconfig ) ; this . _clean = this . _cleanSVGO ; }
SVG Sprite generator

@param {Object} options            Options
@return {SVGSprite}                SVG sprite generator instance
@throws {Error}
SVG Sprite generator