1
0
Fork 0
mirror of https://github.com/actions/cache.git synced 2025-07-19 21:47:54 +00:00
This commit is contained in:
Caleb Gosiak 2021-09-30 19:28:38 -05:00
parent 0b4a0a4930
commit 7b3fb19462
5 changed files with 28 additions and 22 deletions

View file

@ -9,10 +9,14 @@ export function isGhes(): boolean {
return ghUrl.hostname.toUpperCase() !== "GITHUB.COM";
}
export function formatKey(key: string): string {
return key.replace(/[^\w\s]/gi, "-");
}
export function isExactKeyMatch(key: string, cacheKey?: string): boolean {
return !!(
cacheKey &&
cacheKey.localeCompare(key, undefined, {
formatKey(cacheKey).localeCompare(formatKey(key), undefined, {
sensitivity: "accent"
}) === 0
);