diff --git a/lib/index.js b/lib/index.js index 7da7e40..d1c82d9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -42,7 +42,11 @@ module.exports = R.curry(function svgToReact (opts, source) { }). map(sanitize); + function rawStringify(data){ + return 'module.exports = ' + JSON.stringify(data); + } + return options.raw ? - tree.map(JSON.stringify.bind(JSON)) : + tree.map(rawStringify) : tree.map(stringify); });