aboutsummaryrefslogtreecommitdiff
path: root/node_modules/json-loader/index.js
blob: ea4f387de40792f88a85c93c8d343c09dc7be68b (plain)
1
2
3
4
5
6
7
8
9
10
11
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}`;
}