mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-23 13:09:27 +08:00
@@ -0,0 +1,25 @@
|
||||
export enum StringComparer {
|
||||
Ordinal,
|
||||
OrdinalIgnoreCase,
|
||||
}
|
||||
|
||||
export function isEqual(str1: string, str2: string, stringComparer: StringComparer): boolean {
|
||||
|
||||
if (str1 == null && str2 == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (str1 == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (str2 == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (stringComparer == StringComparer.OrdinalIgnoreCase) {
|
||||
return str1.toUpperCase() === str2.toUpperCase();
|
||||
} else {
|
||||
return str1 === str2;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user