From 8dc86e9d51110efe011062c4a2f3b77d32b8ba92 Mon Sep 17 00:00:00 2001 From: dorianrod <33071955+dorianrod@users.noreply.github.com> Date: Mon, 20 Apr 2020 17:16:33 +0200 Subject: [PATCH] fix raw stringify --- lib/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); });