/var/www/greso.tech/server/nsm/node_modules/extract-svg-path
Edit: /var/www/greso.tech/server/nsm/node_modules/extract-svg-path/browser.js (836B)
var parseXml = require('xml-parse-from-string')
function extractSvgPath (svgDoc) {
// concat all the
elements to form an SVG path string
if (typeof svgDoc === 'string') {
svgDoc = parseXml(svgDoc)
}
if (!svgDoc || typeof svgDoc.getElementsByTagName !== 'function') {
throw new Error('could not get an XML document from the specified SVG contents')
}
var paths = Array.prototype.slice.call(svgDoc.getElementsByTagName('path'))
return paths.reduce(function (prev, path) {
var d = path.getAttribute('d') || ''
return prev + ' ' + d.replace(/\s+/g, ' ').trim()
}, '').trim()
}
module.exports = function () {
throw new Error('use extract-svg-path/transform to inline SVG contents into your bundle')
}
module.exports.parse = extractSvgPath
//deprecated
module.exports.fromString = extractSvgPath