Skip to content

Commit

Permalink
fix(angular): get params types (#5390)
Browse files Browse the repository at this point in the history
  • Loading branch information
vltansky authored Jan 24, 2022
1 parent 3543612 commit 8731204
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/angular/src/utils/get-params.ts
Original file line number Diff line number Diff line change
@@ -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])) {
Expand Down

0 comments on commit 8731204

Please sign in to comment.