You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

json-perf-loader

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-perf-loader - npm Package Compare versions

Comparing version

to
1.0.2

2

package.json
{
"name": "json-perf-loader",
"version": "1.0.1",
"version": "1.0.2",
"description": "A loader for webpack to load JSON with performance advice",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -16,6 +16,5 @@ const { getOptions } = require('loader-utils')

console.log(source)
let value
try {

@@ -26,14 +25,14 @@ value = typeof source === 'string' ? JSON.parse(source) : source

}
if (shouldInline(options.limit, source.length)) {
value = JSON.stringify(value)
.replace(/\u2028/g, '\\u2028')
.replace(/\u2029/g, '\\u2029')
.replace(/\u2028/g, '\\u2028')
.replace(/\u2029/g, '\\u2029')
return `module.exports = ${value}`
}
return `module.exports = JSON.parse('${source}')`
return `module.exports = JSON.parse('${JSON.stringify(value)}')`
}
exports.raw = true;