scripts/patch-package.js
function visitPackageJSON(folderPath)
{
  let files = fs.readdirSync(folderPath);
  for (var i in files) {
    let name = files[i];
    let filePath = path.join(folderPath, files[i]);
    if(fs.statSync(filePath).isDirectory()) {
      visitPackageJSON(filePath);
    } else {
      if (name === 'package.json') {
        try {
          patchPackageJSON_preNodeGyp_modulePath(filePath);
        } catch (e) {
          console.warn(
            'Failed to patch the file : "' +
            filePath +
            '". The following error was thrown: ' +
            JSON.stringify(e)
          );
        }
      }
    }
  }
}
function visitPackageJSON(folderPath)
{
  let files = fs.readdirSync(folderPath);
  for (var i in files) {
    let name = files[i];
    let filePath = path.join(folderPath, files[i]);
    if(fs.statSync(filePath).isDirectory()) {
      visitPackageJSON(filePath);
    } else {
      if (name === 'package.json') {
        try {
          patchPackageJSON_preNodeGyp_modulePath(filePath);
        } catch (e) {
          console.warn(
            'Failed to patch the file : "' +
            filePath +
            '". The following error was thrown: ' +
            JSON.stringify(e)
          );
        }
      }
    }
  }
}
function visitPackageJSON ( folderPath ) { let files = fs . readdirSync ( folderPath ) ; for ( var i in files ) { let name = files [ i ] ; let filePath = path . join ( folderPath , files [ i ] ) ; if ( fs . statSync ( filePath ) . isDirectory ( ) ) { visitPackageJSON ( filePath ) ; } else { if ( name === 'package.json' ) { try { patchPackageJSON_preNodeGyp_modulePath ( filePath ) ; } catch ( e ) { console . warn ( 'Failed to patch the file : "' + filePath + '". The following error was thrown: ' + JSON . stringify ( e ) ) ; } } } } }
Visits every package.json to apply patches.
Visits every package . json to apply patches .