diff options
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}`; +} |