mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-13 07:40:59 +00:00
fix(native): sort the offline manifest with localeCompare, so Sonar's reliability gate holds
This commit is contained in:
@@ -88,7 +88,7 @@ export async function keepOfflineShellFresh(fetchImpl: typeof fetch = fetch, lan
|
||||
if (!response.ok) return;
|
||||
const files = manifestFiles(await response.json(), language);
|
||||
// The build and the language together: a new language needs its own chunk.
|
||||
const build = `${[...files].sort().find((f) => /index-[^/]+\.js$/.test(f)) ?? files.length}:${language ?? 'en'}`;
|
||||
const build = `${[...files].sort((a, b) => a.localeCompare(b)).find((f) => /index-[^/]+\.js$/.test(f)) ?? files.length}:${language ?? 'en'}`;
|
||||
if (warmedBuild() === build) return;
|
||||
const complete = await warmCache(files, (path) =>
|
||||
fetchImpl(path, { priority: 'low' } as RequestInit).then((r) => r.blob())
|
||||
|
||||
Reference in New Issue
Block a user