"1234"
и вся твоя сортировка пойдёт лесом.let code_list = {
"0014" : { "far" : "itar" },
"0143" : { "itih" : "sarat" },
"0067" : { "sur" : "gures" },
"1234" : { "lol" : "kek" },
"0013" : { "gar" : "unar" },
};
code_list = Object.keys(code_list).sort().reduce(
(obj, key) => {
obj[key] = code_list[key];
return obj;
},
{}
);
console.log(JSON.stringify(code_list));
// {"1234":{"lol":"kek"},"0013":{"gar":"unar"},"0014":{"far":"itar"},"0067":{"sur":"gures"},"0143":{"itih":"sarat"}}