function jsonWrap(n,d){
  let j = JSON.stringify(d);
  return `(function(){
  var inNode = !(typeof Window === 'function' &&
                 Window.prototype.isPrototypeOf(this));
  var root = inNode?module.exports:this;

  if(typeof root.IMPORT_DATA === 'undefined'){
    root.IMPORT_DATA = new Map();
  }
  // NOTE: this section is filled in by sed.
  let data = [
    ${j}
  ]; //end data
  if(data.length == 1) {
    data = data[0];
  }
  root.IMPORT_DATA.set('${n}',data);
})();
`;
}
/* This function is essentially sed mimicry.
   Early versions of the code used 'sed' at install-time to convert
   json files into javascript files loadable via a script tag, essentially
   a safer form of jsonp. For the few bits of code that depended on this,
   we have jsonWrap() which duplicates the old sed script behavior.
 */
This function is essentially sed mimicry.
Early versions of the code used 'sed' at install-time to convert
json files into javascript files loadable via a script tag, essentially
a safer form of jsonp. For the few bits of code that depended on this,
we have jsonWrap() which duplicates the old sed script behavior.
This function is essentially sed mimicry . Early versions of the code used ' sed ' at install - time to convert json files into javascript files loadable via a script tag essentially a safer form of jsonp . For the few bits of code that depended on this we have jsonWrap () which duplicates the old sed script behavior .
function jsonWrap(n,d){
  let j = JSON.stringify(d);
  return `(function(){
  var inNode = !(typeof Window === 'function' &&
                 Window.prototype.isPrototypeOf(this));
  var root = inNode?module.exports:this;
  if(typeof root.IMPORT_DATA === 'undefined'){
    root.IMPORT_DATA = new Map();
  }
  // NOTE: this section is filled in by sed.
  let data = [
    ${j}
  ]; //end data
  if(data.length == 1) {
    data = data[0];
  }
  root.IMPORT_DATA.set('${n}',data);
})();
`;
}
function jsonWrap ( n , d ) { let j = JSON . stringify ( d ) ; return ` ${ j } ${ n } ` ; }
This function is essentially sed mimicry.
This function is essentially sed mimicry .