(body: T)
| 24 | * Object.assign(entity, stripProtectedFields(req.body)) |
| 25 | */ |
| 26 | export function stripProtectedFields<T extends Record<string, unknown>>(body: T): Omit<T, ProtectedField> { |
| 27 | const sanitized = { ...body } |
| 28 | for (const field of PROTECTED_FIELDS) { |
| 29 | delete sanitized[field] |
| 30 | } |
| 31 | return sanitized as Omit<T, ProtectedField> |
| 32 | } |
no outgoing calls
no test coverage detected