fix 'k' variable as a Number in splice method
This commit is contained in:
parent
717ead02b2
commit
db7f34a21d
|
@ -14,7 +14,7 @@ export class CustomizationService {
|
||||||
const isArray = obj instanceof Array;
|
const isArray = obj instanceof Array;
|
||||||
for (let k in obj) {
|
for (let k in obj) {
|
||||||
if (obj[k] === null || obj[k] === '') {
|
if (obj[k] === null || obj[k] === '') {
|
||||||
isArray ? obj.splice(k, 1) : delete obj[k];
|
isArray ? obj.splice(Number.parseInt(k), 1) : delete obj[k];
|
||||||
} else if (typeof obj[k] === 'object') {
|
} else if (typeof obj[k] === 'object') {
|
||||||
CustomizationService.removeNulls(obj[k]);
|
CustomizationService.removeNulls(obj[k]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue