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 sortArrayOfPropertiesLocale
Description: Orchestrator Function to Sort an Array of Properties using International Locale
publicstaticsortArrayOfPropertiesLocale(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.compareTwoStringLocale(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.
