(target, fields)
| 24 | // __proto__/constructor/prototype could pollute Object.prototype during |
| 25 | // _rebuildIndex (see GHSA-2cjr-5v3h-v2w4). |
| 26 | function safeAssign(target, fields) { |
| 27 | if (!fields || typeof fields !== 'object') return target; |
| 28 | const keys = Object.keys(fields); |
| 29 | for (let i = 0; i < keys.length; i++) { |
| 30 | const k = keys[i]; |
| 31 | if (k === '__proto__' || k === 'constructor' || k === 'prototype') continue; |
| 32 | target[k] = fields[k]; |
| 33 | } |
| 34 | return target; |
| 35 | } |
| 36 | |
| 37 | function sanitizeRow(row) { |
| 38 | if (!row || typeof row !== 'object') return row; |
no outgoing calls
no test coverage detected