function requestParamHandler(params: any): any {
if (typeof params == "object") {
for (let key of Object.keys(params)) {
if (params[key] == null) {
delete params[key];
}
if (params[key] instanceof Array) {
const arr: any[] = [];
const list: any[] = params[key];
for (let listElement of list) {
const abj = requestParamHandler(listElement);
abj && arr.push(abj);
}
params[key] = arr;
}
}
}
return params;
}
网友评论