generateDependencyPatches(dependencies) {
    const patches = [];
    const usedDeps = {};
    // const usedDev = {};

    for (let dep in dependencies) {
      let {
        files
      } = dependencies[dep];
      let dev = true;

      for (let file of files) {
        if (!minimatch(file, this.dev)) {
          dev = false;
          break;
        }
      }

      usedDeps[dep] = true;

      if (dev && !(dep in this.devDependencies) && !(dep in this.dependencies)) {
        patches.push(new Patch(Patch.ADD, {
          name: dep,
          dev,
          files
        }));
      } else if (!dev && !(dep in this.dependencies)) {
        patches.push(new Patch(Patch.ADD, {
          name: dep,
          files
        }));
      } else {
        if (dep in this.devDependencies) {
          patches.push(new Patch(Patch.UPDATE, {
            name: dep,
            dev: true,
            files
          }));
        } else if (dep in this.dependencies) {
          patches.push(new Patch(Patch.UPDATE, {
            name: dep,
            files
          }));
        }
      }
    }

    for (let dep in this.dependencies) {
      if (!usedDeps[dep] && this.exclude.indexOf(dep) < 0) {
        patches.push(new Patch(Patch.REMOVE, {
          name: dep
        }))
      }
    }

    return patches;
  }
/**
   * Compares a dependency object (as returned from {@link Package#analyzeSourceDependencies})
   * with the dependencies listed in {@link Package@packageJson} and returns an
   * array of patches.
   * @param {object} dependencies - The dependencies to generate a patch for.
   * @return {Patch[]} - The patches that will make {@link Package#packageJson} match the inputted dependencies
   */
Compares a dependency object (as returned from  Package#analyzeSourceDependencies)
with the dependencies listed in  Package and returns an
array of patches.
@param {object} dependencies - The dependencies to generate a patch for.
@return {Patch[]} - The patches that will make  Package#packageJson match the inputted dependencies
Compares a dependency object ( as returned from Package#analyzeSourceDependencies ) with the dependencies listed in Package and returns an array of patches . @param { object } dependencies - The dependencies to generate a patch for . @return { Patch [] } - The patches that will make Package#packageJson match the inputted dependencies
generateDependencyPatches(dependencies) {
    const patches = [];
    const usedDeps = {};
    for (let dep in dependencies) {
      let {
        files
      } = dependencies[dep];
      let dev = true;
      for (let file of files) {
        if (!minimatch(file, this.dev)) {
          dev = false;
          break;
        }
      }
      usedDeps[dep] = true;
      if (dev && !(dep in this.devDependencies) && !(dep in this.dependencies)) {
        patches.push(new Patch(Patch.ADD, {
          name: dep,
          dev,
          files
        }));
      } else if (!dev && !(dep in this.dependencies)) {
        patches.push(new Patch(Patch.ADD, {
          name: dep,
          files
        }));
      } else {
        if (dep in this.devDependencies) {
          patches.push(new Patch(Patch.UPDATE, {
            name: dep,
            dev: true,
            files
          }));
        } else if (dep in this.dependencies) {
          patches.push(new Patch(Patch.UPDATE, {
            name: dep,
            files
          }));
        }
      }
    }
    for (let dep in this.dependencies) {
      if (!usedDeps[dep] && this.exclude.indexOf(dep) < 0) {
        patches.push(new Patch(Patch.REMOVE, {
          name: dep
        }))
      }
    }
    return patches;
  }
generateDependencyPatches ( dependencies ) { const patches = [ ] ; const usedDeps = { } ; for ( let dep in dependencies ) { let { files } = dependencies [ dep ] ; let dev = true ; for ( let file of files ) { if ( ! minimatch ( file , this . dev ) ) { dev = false ; break ; } } usedDeps [ dep ] = true ; if ( dev && ! ( dep in this . devDependencies ) && ! ( dep in this . dependencies ) ) { patches . push ( new Patch ( Patch . ADD , { name : dep , dev , files } ) ) ; } else if ( ! dev && ! ( dep in this . dependencies ) ) { patches . push ( new Patch ( Patch . ADD , { name : dep , files } ) ) ; } else { if ( dep in this . devDependencies ) { patches . push ( new Patch ( Patch . UPDATE , { name : dep , dev : true , files } ) ) ; } else if ( dep in this . dependencies ) { patches . push ( new Patch ( Patch . UPDATE , { name : dep , files } ) ) ; } } } for ( let dep in this . dependencies ) { if ( ! usedDeps [ dep ] && this . exclude . indexOf ( dep ) < 0 ) { patches . push ( new Patch ( Patch . REMOVE , { name : dep } ) ) } } return patches ; }
Compares a dependency object (as returned from {@link Package#analyzeSourceDependencies})
 with the dependencies listed in {@link Package@packageJson} and returns an
 array of patches.
Compares a dependency object ( as returned from { @link Package#analyzeSourceDependencies } ) with the dependencies listed in { @link Package@packageJson } and returns an array of patches .
// const usedDev = {};