'use strict';

/**
 * @mixin
 * @alias actions/packege-json
 */
module.exports = (cls) =>
  class extends cls {
    /**
     * @private
     * Resolve the dependencies to be added to the package.json.
     *
     * @param {Object|string|string[]} dependencies
     * @return {Promise} a 'packageName: packageVersion' object
     */
    async _resolvePackageJsonDependencies(dependencies) {
      if (typeof dependencies === 'string') {
        dependencies = [dependencies];
      } else if (typeof dependencies !== 'object') {
        throw new TypeError(
          'resolvePackageJsonDependencies requires an object'
        );
      } else if (!Array.isArray(dependencies)) {
        dependencies = await Promise.all(
          Object.entries(dependencies).map(([pkg, version]) =>
            version
              ? Promise.resolve([pkg, version])
              : this.env.resolvePackage(pkg, version)
          )
        );
        return Object.fromEntries(
          dependencies.filter((...args) => args.length > 0 && args[0])
        );
      }

      const entries = await Promise.all(
        dependencies.map((dependency) => this.env.resolvePackage(dependency))
      );
      return Object.fromEntries(entries);
    }

    /**
     * @private
     * Add dependencies to be added to the package.json.
     *
     * @param {Object|string|string[]} dependencies
     * @return {Promise} a 'packageName: packageVersion' object
     */
    async addDependencies(dependencies) {
      dependencies = await this._resolvePackageJsonDependencies(dependencies);
      this.packageJson.merge({dependencies});
      return dependencies;
    }

    async addDevDependencies(devDependencies) {
      devDependencies = await this._resolvePackageJsonDependencies(
        devDependencies
      );
      this.packageJson.merge({devDependencies});
      return devDependencies;
    }
  };

@@ -1233,32 +1233,16 @@
     /**%0A
-     * @private%0A
      * A
@@ -1256,35 +1256,39 @@
 ndencies to 
-be added to
+the destination
  the package
@@ -1622,24 +1622,224 @@
 ies;%0A    %7D%0A%0A
+    /**%0A     * Add dependencies to the destination the package.json.%0A     *%0A     * @param %7BObject%7Cstring%7Cstring%5B%5D%7D dependencies%0A     * @return %7BPromise%7D a 'packageName: packageVersion' object%0A     */%0A
     async ad

Fix package-json jsdoc.