src/pathformer.js
function Pathformer(element) {
  // Test params
  if (typeof element === 'undefined') {
    throw new Error('Pathformer [constructor]: "element" parameter is required');
  }

  // Set the element
  if (element.constructor === String) {
    element = document.getElementById(element);
    if (!element) {
      throw new Error('Pathformer [constructor]: "element" parameter is not related to an existing ID');
    }
  }
  if (element instanceof window.SVGElement || 
      element instanceof window.SVGGElement ||
      /^svg$/i.test(element.nodeName)) {
    this.el = element;
  } else {
    throw new Error('Pathformer [constructor]: "element" parameter must be a string or a SVGelement');
  }

  // Start
  this.scan(element);
}
function Pathformer(element) {
  // Test params
  if (typeof element === 'undefined') {
    throw new Error('Pathformer [constructor]: "element" parameter is required');
  }

  // Set the element
  if (element.constructor === String) {
    element = document.getElementById(element);
    if (!element) {
      throw new Error('Pathformer [constructor]: "element" parameter is not related to an existing ID');
    }
  }
  if (element instanceof window.SVGElement || 
      element instanceof window.SVGGElement ||
      /^svg$/i.test(element.nodeName)) {
    this.el = element;
  } else {
    throw new Error('Pathformer [constructor]: "element" parameter must be a string or a SVGelement');
  }

  // Start
  this.scan(element);
}
function Pathformer ( element ) { // Test params if ( typeof element === 'undefined' ) { throw new Error ( 'Pathformer [constructor]: "element" parameter is required' ) ; } // Set the element if ( element . constructor === String ) { element = document . getElementById ( element ) ; if ( ! element ) { throw new Error ( 'Pathformer [constructor]: "element" parameter is not related to an existing ID' ) ; } } if ( element instanceof window . SVGElement || element instanceof window . SVGGElement || / ^svg$ / i . test ( element . nodeName ) ) { this . el = element ; } else { throw new Error ( 'Pathformer [constructor]: "element" parameter must be a string or a SVGelement' ) ; } // Start this . scan ( element ) ; }
Pathformer
Beta version

Take any SVG version 1.1 and transform
child elements to 'path' elements

This code is purely forked from
https://github.com/Waest/SVGPathConverter
 
Class constructor

@param {DOM|String} element Dom element of the SVG or id of it
Pathformer Beta version