Use undefined instead of null when dealing with lists.

This commit is contained in:
Federico Builes
2022-06-09 10:42:31 +02:00
parent 6b5518a9ed
commit cc22dcd654

View File

@@ -19,7 +19,7 @@ export function getDeniedLicenseChanges(
deny?: Array<string>
}
): Array<Change> {
let {allow = null, deny = null} = licenses
let {allow, deny} = licenses
let disallowed: Change[] = []
@@ -29,11 +29,11 @@ export function getDeniedLicenseChanges(
if (license === null) {
continue
}
if (allow !== null) {
if (allow !== undefined) {
if (!allow.includes(license)) {
disallowed.push(change)
}
} else if (deny !== null) {
} else if (deny !== undefined) {
if (deny.includes(license)) {
disallowed.push(change)
}