mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
@kbn/telemetry-tools
ensures alphabetical order (#140970)
This commit is contained in:
parent
a9bcb41377
commit
299ff11fc9
3 changed files with 3696 additions and 3690 deletions
|
@ -15,6 +15,12 @@ export function writeToFileTask({ roots }: TaskContext) {
|
|||
task: async () => {
|
||||
const fullPath = path.resolve(process.cwd(), root.config.output);
|
||||
if (root.mapping && Object.keys(root.mapping.properties).length > 0) {
|
||||
// Sort first-level properties alphabetically
|
||||
root.mapping.properties = Object.fromEntries(
|
||||
Object.entries(root.mapping.properties).sort(([a], [b]) => {
|
||||
return a > b ? 1 : -1;
|
||||
})
|
||||
);
|
||||
const serializedMapping = JSON.stringify(root.mapping, null, 2).concat('\n');
|
||||
await writeFileAsync(fullPath, serializedMapping);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue