PHP WebShell

Текущая директория: /opt/BitGoJS/node_modules/@lerna/publish/lib

Просмотр файла: get-packages-without-license.js

"use strict";

const path = require("path");

module.exports.getPackagesWithoutLicense = getPackagesWithoutLicense;

/**
 * Retrieve a list of packages that lack a license file.
 * @param {Project} project
 * @param {Package[]} packagesToPublish
 * @returns {Package[]}
 */
function getPackagesWithoutLicense(project, packagesToPublish) {
  return project.getPackageLicensePaths().then((licensePaths) => {
    // this assumes any existing license is a sibling of package.json, which is pretty safe
    // it also dedupes package locations, since we don't care about duplicate license files
    const licensed = new Set(licensePaths.map((lp) => path.dirname(lp)));

    return packagesToPublish.filter((pkg) => !licensed.has(pkg.location));
  });
}

Выполнить команду


Для локальной разработки. Не используйте в интернете!