Use undefined instead of null when dealing with lists.
This commit is contained in:
+3
-3
@@ -19,7 +19,7 @@ export function getDeniedLicenseChanges(
|
|||||||
deny?: Array<string>
|
deny?: Array<string>
|
||||||
}
|
}
|
||||||
): Array<Change> {
|
): Array<Change> {
|
||||||
let {allow = null, deny = null} = licenses
|
let {allow, deny} = licenses
|
||||||
|
|
||||||
let disallowed: Change[] = []
|
let disallowed: Change[] = []
|
||||||
|
|
||||||
@@ -29,11 +29,11 @@ export function getDeniedLicenseChanges(
|
|||||||
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