Skip to content

Commit e2f93ef

Browse files
refactor(): move condition to filter function
1 parent 4b73ca6 commit e2f93ef

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

packages/common/pipes/validation.pipe.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,10 @@ export class ValidationPipe implements PipeTransform<any> {
9494
}
9595

9696
private stripProtoKeys(value: Record<string, any>) {
97-
if (isNil(value)) { return; }
9897
delete value.__proto__;
9998
const keys = Object.keys(value);
10099
keys
101-
.filter(key => typeof value[key] === 'object')
100+
.filter(key => typeof value[key] === 'object' && value[key])
102101
.forEach(key => this.stripProtoKeys(value[key]));
103102
}
104103
}

0 commit comments

Comments
 (0)