Function: sanitizeMetadata()
ts
function sanitizeMetadata<T>(metadata: T): T;Defined in: src/batteries/vector/helpers.ts:68
Strip __proto__/prototype/constructor keys from caller-supplied metadata before an adapter spreads or assigns it onto a record bound for storage. Every adapter's own-object targets ({} literals) are already immune to prototype reassignment, but a stray __proto__-keyed record would otherwise round-trip verbatim through storage and back out to a caller — this keeps the stored shape honest regardless.
Type Parameters
| Type Parameter |
|---|
T extends | Record<string, unknown> | undefined |
Parameters
| Parameter | Type |
|---|---|
metadata | T |
Returns
T