Skip to content

Commit a666cd0

Browse files
committed
Added case insensitive string compare
1 parent 7b746b7 commit a666cd0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

server/src/extensions/stringExtensions.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ declare global {
66
stripQuotes(): string;
77
toFilePath(): string;
88
toFileUri(): string;
9+
ciEquals(s: string): boolean;
910
}
1011
}
1112

@@ -25,3 +26,9 @@ String.prototype.toFileUri = function (): string {
2526
? pathToFileURL(this.toString()).href
2627
: this.toString();
2728
};
29+
30+
String.prototype.ciEquals = function (s: string): boolean {
31+
return this.localeCompare(s, undefined, {
32+
sensitivity: 'accent'
33+
}) === 0;
34+
};

0 commit comments

Comments
 (0)