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
+3 -3
View File
@@ -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)
} }