mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-29 08:19:26 +08:00
added nullcheck
This commit is contained in:
@@ -43,5 +43,6 @@ export function cleanLabel(label: string): string {
|
|||||||
.replace(/[^-A-Za-z0-9_.]/gi, '')
|
.replace(/[^-A-Za-z0-9_.]/gi, '')
|
||||||
|
|
||||||
const regex = /([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]/
|
const regex = /([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]/
|
||||||
return regex.exec(removedInvalidChars)[0] || ''
|
const regexResult = regex.exec(removedInvalidChars) || ['']
|
||||||
|
return regexResult[0]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user