code: function flatten(pkg, dependencies = {}) {
    _.forEach(pkg.dependencies, (dep, id) => {
      if (!_.has(dependencies, id)) {
        // Store current dependency...
        dependencies[id] = dep;
  
        // ... and add transitive dependencies
        _.extend(dependencies, flatten(dep, dependencies));
      }
    });
  
    return dependencies;
  }
docs: Flatten dependency tree into a single dependency object:
  - Object entry is the dependency name (i.e package name).
  - Object value is the dependency metadata.
  
  @param {Object} pkg The package entrypoint.
  @param {Object} dependencies Current dependencies (object populated and returned).
  @return {Object} The dependencies.