diff --git a/packages/common/src/simple-deep-clone.ts b/packages/common/src/simple-deep-clone.ts index 31109eae73..273dd30e05 100644 --- a/packages/common/src/simple-deep-clone.ts +++ b/packages/common/src/simple-deep-clone.ts @@ -2,7 +2,7 @@ * An extremely fast function for deep-cloning an object which only contains simple * values, i.e. primitives, arrays and nested simple objects. */ -export function simpleDeepClone(input: T): T { +export function simpleDeepClone(input: T): T { // if not array or object or is null return self if (typeof input !== 'object' || input === null) { return input; @@ -21,7 +21,7 @@ export function simpleDeepClone(input: T): T { // handle case: object output = {}; for (i in input) { - if (input.hasOwnProperty(i)) { + if ((input).hasOwnProperty(i)) { output[i] = simpleDeepClone((input as any)[i]); } } diff --git a/packages/core/src/api/middleware/translate-errors-extension.ts b/packages/core/src/api/middleware/translate-errors-extension.ts index 16ed9add9d..fb51938772 100644 --- a/packages/core/src/api/middleware/translate-errors-extension.ts +++ b/packages/core/src/api/middleware/translate-errors-extension.ts @@ -1,4 +1,5 @@ import { Response } from 'express-serve-static-core'; +import { GraphQLError } from 'graphql'; import { GraphQLExtension, GraphQLResponse } from 'graphql-extensions'; import { I18nRequest, I18nService } from '../../i18n/i18n.service'; @@ -20,7 +21,7 @@ export class TranslateErrorExtension implements GraphQLExtension { const { graphqlResponse, context } = o; if (graphqlResponse.errors) { graphqlResponse.errors = graphqlResponse.errors.map(err => { - return this.i18nService.translateError(context.req, err) as any; + return this.i18nService.translateError(context.req, err as GraphQLError) as any; }); } return o; diff --git a/packages/core/src/common/configurable-operation.ts b/packages/core/src/common/configurable-operation.ts index 7c1f023853..71df413a45 100644 --- a/packages/core/src/common/configurable-operation.ts +++ b/packages/core/src/common/configurable-operation.ts @@ -60,10 +60,10 @@ export function configurableDefToOperation(def: ConfigurableOperationDef): Confi * { foo: 'bar' } **/ export function argsArrayToHash(args: ConfigArg[]): ConfigArgValues { - const output: ConfigArgValues & { [key: string]: any } = {} as any; + const output: ConfigArgValues = {} as any; for (const arg of args) { if (arg.value != null) { - output[arg.name] = coerceValueToType(arg); + output[arg.name as keyof ConfigArgValues] = coerceValueToType(arg); } } return output; diff --git a/packages/core/src/service/helpers/list-query-builder/parse-filter-params.ts b/packages/core/src/service/helpers/list-query-builder/parse-filter-params.ts index 30f6c4be03..13bfedd12c 100644 --- a/packages/core/src/service/helpers/list-query-builder/parse-filter-params.ts +++ b/packages/core/src/service/helpers/list-query-builder/parse-filter-params.ts @@ -47,7 +47,7 @@ export function parseFilterParams( for (const [key, operation] of Object.entries(filterParams)) { if (operation) { - for (const [operator, operand] of Object.entries(operation)) { + for (const [operator, operand] of Object.entries(operation as object)) { let fieldName: string; if (columns.find(c => c.propertyName === key)) { fieldName = `${alias}.${key}`; diff --git a/packages/core/src/service/helpers/list-query-builder/parse-sort-params.ts b/packages/core/src/service/helpers/list-query-builder/parse-sort-params.ts index 455e94ac33..cf888a6053 100644 --- a/packages/core/src/service/helpers/list-query-builder/parse-sort-params.ts +++ b/packages/core/src/service/helpers/list-query-builder/parse-sort-params.ts @@ -39,9 +39,9 @@ export function parseSortParams( for (const [key, order] of Object.entries(sortParams)) { if (columns.find(c => c.propertyName === key)) { - output[`${alias}.${key}`] = order; + output[`${alias}.${key}`] = order as any; } else if (translationColumns.find(c => c.propertyName === key)) { - output[`${alias}_translations.${key}`] = order; + output[`${alias}_translations.${key}`] = order as any; } else { throw new UserInputError('error.invalid-sort-field', { fieldName: key,