From 363723fc84f7b8477592e0105aeb331ec9a017af Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 14 Aug 2017 05:01:11 +0200 Subject: node_modules --- node_modules/json-loader/index.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'node_modules/json-loader/index.js') 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}`; +} -- cgit v1.2.3