diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/json-loader/index.js | |
parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) |
node_modules
Diffstat (limited to 'node_modules/json-loader/index.js')
-rw-r--r-- | node_modules/json-loader/index.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/node_modules/json-loader/index.js b/node_modules/json-loader/index.js index a51ba3aeb..ea4f387de 100644 --- a/node_modules/json-loader/index.js +++ b/node_modules/json-loader/index.js @@ -1,10 +1,11 @@ -/*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Tobias Koppers @sokra
-*/
-module.exports = function(source) {
- this.cacheable && this.cacheable();
- var value = typeof source === "string" ? JSON.parse(source) : source;
- this.value = [value];
- return "module.exports = " + JSON.stringify(value, undefined, "\t") + ";";
-}
+module.exports = function (source) { + if (this.cacheable) this.cacheable(); + + var value = typeof source === "string" ? JSON.parse(source) : source; + + value = JSON.stringify(value) + .replace(/\u2028/g, '\\u2028') + .replace(/\u2029/g, '\\u2029'); + + return `module.exports = ${value}`; +} |