Orchestrator Function: Sort an Array of Properties

by Simon Sparks · 29 January 2026

To use this function add it to the class library file named Utilities.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: Utilities.ts

Function sortArrayOfProperties

Description: Orchestrator Function to Sort an Array of Properties

publicstaticsortArrayOfProperties(arrProperties:Properties[],enumSortOrder:SortOrder=SortOrder.Forward):Properties[]{

arrProperties=arrProperties.sort((objPropertiesA: Properties,objPropertiesB: Properties):number=>{

letstrA:string=objPropertiesA.get<string>("label");
letstrB:string=objPropertiesB.get<string>("label");

returnthis.compareTwoString(strA,strB,enumSortOrder);
});

returnarrProperties;
}

Enumeration: SortOrder

exportenumSortOrder{
Forward="Forward",
Reverse="Reverse"
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like