mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor: Upgrade to TypeScript 5.5 (no-changelog) (#9828)
This commit is contained in:
@@ -377,8 +377,10 @@ export function applyDeclarativeNodeOptionParameters(nodeType: INodeType): void
|
||||
],
|
||||
};
|
||||
|
||||
if (parameters[existingRequestOptionsIndex]?.options) {
|
||||
parameters[existingRequestOptionsIndex].options!.sort((a, b) => {
|
||||
const options = parameters[existingRequestOptionsIndex]?.options;
|
||||
|
||||
if (options) {
|
||||
options.sort((a, b) => {
|
||||
if ('displayName' in a && 'displayName' in b) {
|
||||
if (a.displayName < b.displayName) {
|
||||
return -1;
|
||||
|
||||
@@ -441,12 +441,8 @@ export class RoutingNode {
|
||||
// Sort the returned options
|
||||
const sortKey = action.properties.key;
|
||||
inputData.sort((a, b) => {
|
||||
const aSortValue = a.json[sortKey]
|
||||
? (a.json[sortKey]?.toString().toLowerCase() as string)
|
||||
: '';
|
||||
const bSortValue = b.json[sortKey]
|
||||
? (b.json[sortKey]?.toString().toLowerCase() as string)
|
||||
: '';
|
||||
const aSortValue = a.json[sortKey]?.toString().toLowerCase() ?? '';
|
||||
const bSortValue = b.json[sortKey]?.toString().toLowerCase() ?? '';
|
||||
if (aSortValue < bSortValue) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -39,8 +39,9 @@ export class WorkflowHooks {
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async executeHookFunctions(hookName: string, parameters: any[]) {
|
||||
if (this.hookFunctions[hookName] !== undefined && Array.isArray(this.hookFunctions[hookName])) {
|
||||
for (const hookFunction of this.hookFunctions[hookName]!) {
|
||||
const hooks = this.hookFunctions[hookName];
|
||||
if (hooks !== undefined && Array.isArray(hooks)) {
|
||||
for (const hookFunction of hooks) {
|
||||
await hookFunction.apply(this, parameters);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,8 +186,8 @@ for (const evaluator of ['tmpl', 'tournament'] as const) {
|
||||
}
|
||||
test(t.expression, () => {
|
||||
const evaluationTests = t.tests.filter(
|
||||
(test) => test.type === 'evaluation',
|
||||
) as ExpressionTestEvaluation[];
|
||||
(test): test is ExpressionTestEvaluation => test.type === 'evaluation',
|
||||
);
|
||||
|
||||
for (const test of evaluationTests) {
|
||||
const input = test.input.map((d) => ({ json: d })) as any;
|
||||
@@ -209,8 +209,8 @@ for (const evaluator of ['tmpl', 'tournament'] as const) {
|
||||
}
|
||||
test(t.expression, () => {
|
||||
for (const test of t.tests.filter(
|
||||
(test) => test.type === 'transform',
|
||||
) as ExpressionTestTransform[]) {
|
||||
(test): test is ExpressionTestTransform => test.type === 'transform',
|
||||
)) {
|
||||
const expr = t.expression;
|
||||
expect(extendSyntax(expr, test.forceTransform)).toEqual(test.result ?? expr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user