codexmate 0.1.38 → 0.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,18 @@
1
+ import { localeKeys } from './keys.mjs';
2
+
3
+ // Contiguous key runs keep each locale's original enumeration order. Zero
4
+ // represents an exact match with the base locale, never a missing translation.
5
+ function expandWebLocale(runs, values, base) {
6
+ const entries = [];
7
+ let offset = 0;
8
+ for (const [start, count] of runs) {
9
+ for (let index = start; index < start + count; index++) {
10
+ const key = localeKeys[index];
11
+ const value = values[offset++];
12
+ entries.push([key, value === 0 ? base[key] : value]);
13
+ }
14
+ }
15
+ return Object.freeze(Object.fromEntries(entries));
16
+ }
17
+
18
+ export { expandWebLocale };