Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Commit 878c801

Browse files
committed
Normalises array and property order in data files
1 parent ade127d commit 878c801

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/Ldml2Json.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ function processObj(data) {
185185
// Get own property values, useful for converting object map to array when we
186186
// don't care about the keys. Relies on predictable property ordering in V8.
187187
gopv = function (o) {
188-
return o ? Object.getOwnPropertyNames(o).map(function (e) { return o[e]; }) : undefined;
188+
return o ? Object.getOwnPropertyNames(o).map(function (e) { return o[e]; }).sort() : undefined;
189189
},
190190

191191
// Copy numbering systems
@@ -294,10 +294,10 @@ function processObj(data) {
294294
ret.number.patterns.secondaryGroupSize = groups[1].length;
295295

296296
// Copy the currency symbols
297-
for (var k in data.numbers.currencies) {
297+
gopn(data.numbers.currencies).forEach(function (k) {
298298
if (k !== data.numbers.currencies[k].symbol)
299299
ret.number.currencies[k] = data.numbers.currencies[k].symbol;
300-
}
300+
});
301301

302302

303303
// Copy the formatting information

0 commit comments

Comments
 (0)