Updating dist.
This commit is contained in:
+8
-3
@@ -71,12 +71,17 @@ exports.getDeniedLicenseChanges = void 0;
|
|||||||
/**
|
/**
|
||||||
* Loops through a list of changes, filtering and returning the
|
* Loops through a list of changes, filtering and returning the
|
||||||
* ones that don't conform to the licenses allow/deny lists.
|
* ones that don't conform to the licenses allow/deny lists.
|
||||||
|
*
|
||||||
|
* Keep in mind that we don't let users specify both an allow and a deny
|
||||||
|
* list in their config files, so this code works under the assumption that
|
||||||
|
* one of the two list parameters will be empty. If both lists are provided,
|
||||||
|
* we will ignore the deny list.
|
||||||
* @param {Change[]} changes The list of changes to filter.
|
* @param {Change[]} changes The list of changes to filter.
|
||||||
* @param { { allow?: string[], deny?: string[]}} licenses An object with `allow`/`deny` keys, each containing a list of licenses.
|
* @param { { allow?: string[], deny?: string[]}} licenses An object with `allow`/`deny` keys, each containing a list of licenses.
|
||||||
* @returns {Array<Change} The list of denied changes.
|
* @returns {Array<Change} The list of denied changes.
|
||||||
*/
|
*/
|
||||||
function getDeniedLicenseChanges(changes, licenses) {
|
function getDeniedLicenseChanges(changes, licenses) {
|
||||||
let { allow = null, deny = null } = licenses;
|
let { allow, deny } = licenses;
|
||||||
let disallowed = [];
|
let disallowed = [];
|
||||||
for (const change of changes) {
|
for (const change of changes) {
|
||||||
let license = change.license;
|
let license = change.license;
|
||||||
@@ -84,12 +89,12 @@ function getDeniedLicenseChanges(changes, licenses) {
|
|||||||
if (license === null) {
|
if (license === null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (allow !== null) {
|
if (allow !== undefined) {
|
||||||
if (!allow.includes(license)) {
|
if (!allow.includes(license)) {
|
||||||
disallowed.push(change);
|
disallowed.push(change);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (deny !== null) {
|
else if (deny !== undefined) {
|
||||||
if (deny.includes(license)) {
|
if (deny.includes(license)) {
|
||||||
disallowed.push(change);
|
disallowed.push(change);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user