From 4b3e32eef8da03bc41801b228c14d7aa3b0c5e2a Mon Sep 17 00:00:00 2001 From: Vlad Tansky Date: Mon, 24 Jan 2022 13:34:36 +0200 Subject: [PATCH] fix(angular): get params types --- src/angular/src/utils/get-params.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/angular/src/utils/get-params.ts b/src/angular/src/utils/get-params.ts index aa88ac94b..aa3bfb28c 100644 --- a/src/angular/src/utils/get-params.ts +++ b/src/angular/src/utils/get-params.ts @@ -1,24 +1,23 @@ -// eslint-disable-next-line import { isObject, extend } from './utils'; import { paramsList } from './params-list'; // @ts-ignore import Swiper from 'swiper'; - +type KeyValueType = { [x: string]: any }; export const allowedParams = paramsList.map((key) => key.replace(/_/, '')); export function getParams(obj: any = {}) { const params: any = { on: {}, }; - const events = {}; - const passedParams = {}; + // const events = {}; + const passedParams: KeyValueType = {}; extend(params, Swiper.defaults); extend(params, Swiper.extendedDefaults); params._emitClasses = true; params.init = false; - const rest = {}; + const rest: KeyValueType = {}; const allowedParams = paramsList.map((key) => key.replace(/_/, '')); - Object.keys(obj).forEach((key) => { + Object.keys(obj).forEach((key: string) => { const _key = key.replace(/^_/, ''); if (allowedParams.indexOf(_key) >= 0) { if (isObject(obj[key])) {