perf: Make frontend linting faster (no-changelog) (#7717)

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Csaba Tuncsik
2023-11-22 15:01:22 +01:00
committed by GitHub
parent e01617ad64
commit 50f568560f
22 changed files with 430 additions and 492 deletions

View File

@@ -37,17 +37,18 @@ export const useExternalSecretsStore = defineStore('externalSecrets', () => {
secretAcc[secret] = '*********';
return secretAcc;
}
const obj = (secretAcc[splitSecret[0]] ?? {}) as object;
let acc: any = obj;
const obj = secretAcc[splitSecret[0]] ?? {};
let acc = obj;
for (let i = 1; i < splitSecret.length; i++) {
const key = splitSecret[i];
const key = splitSecret[i] as keyof typeof acc;
// Actual value key
if (i === splitSecret.length - 1) {
acc[key] = '*********';
const key = splitSecret[i] as keyof typeof acc;
acc[key] = '*********' as (typeof acc)[typeof key];
continue;
}
if (!(key in acc)) {
acc[key] = {};
if (Object.keys(acc) && !acc[key]) {
acc[key] = {} as (typeof acc)[typeof key];
}
acc = acc[key];
}

View File

@@ -750,16 +750,14 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
}
// Check if the same connection exists already
const checkProperties = ['index', 'node', 'type'];
let propertyName: string;
const checkProperties = ['index', 'node', 'type'] as Array<keyof IConnection>;
let propertyName: keyof IConnection;
let connectionExists = false;
connectionLoop: for (const existingConnection of this.workflow.connections[sourceData.node][
sourceData.type
][sourceData.index]) {
for (propertyName of checkProperties) {
if (
(existingConnection as any)[propertyName] !== (destinationData as any)[propertyName]
) {
if (existingConnection[propertyName] !== destinationData[propertyName]) {
continue connectionLoop;
}
}