UNPKG

@nestjs/common

Version:

Decorators, pipes, exceptions and utilities for NestJS applications: @Controller(), @Injectable(), @Body(), ValidationPipe, HttpException and more.

11 lines (10 loc) • 479 B
/** * Strips dangerous prototype pollution keys (__proto__, prototype, constructor) * from an object recursively. * * The traversal keeps its own stack instead of calling itself, so a value * nested deeper than the call stack does not throw a `RangeError`, and it * skips the objects it has already visited, so a value with a cycle (e.g. an * entity with a two-way relation) is walked once instead of forever. */ export declare function stripProtoKeys(value: any): void;