mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
⚡ Use shared sort function
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
import {
|
||||
IDataObject,
|
||||
ILoadOptionsFunctions,
|
||||
INodePropertyOptions,
|
||||
NodeApiError,
|
||||
NodeOperationError,
|
||||
} from 'n8n-workflow';
|
||||
@@ -261,3 +262,16 @@ export function pipedriveResolveCustomProperties(customProperties: ICustomProper
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
export function sortOptionParameters(optionParameters: INodePropertyOptions[]): INodePropertyOptions[] {
|
||||
optionParameters.sort((a, b) => {
|
||||
const aName = a.name.toLowerCase();
|
||||
const bName = b.name.toLowerCase();
|
||||
if (aName < bName) { return -1; }
|
||||
if (aName > bName) { return 1; }
|
||||
return 0;
|
||||
});
|
||||
|
||||
return optionParameters;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user