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 sortArrayOfString
Description: Orchestrator Function to Sort an Array of Strings
publicstaticsortArrayOfString(arr:string[],enumSortOrder:SortOrder=SortOrder.Forward):string[]{
arr=arr.sort((strA:string,strB:string):1| -1|0=>{
returnUtilities.compareTwoString(strA,strB,enumSortOrder);
});
returnarr;
}Enumeration: SortOrder
exportenumSortOrder{
Forward="Forward",
Reverse="Reverse"
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
