refactor: Upgrade to TypeScript 5.5 (no-changelog) (#9828)

This commit is contained in:
Iván Ovejero
2024-06-24 17:49:59 +02:00
committed by GitHub
parent 1ba656ef4a
commit e33a47311f
16 changed files with 321 additions and 322 deletions

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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);
}
}

View File

@@ -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);
}