API · Transform

omit()

Shallow-copy each record and remove one or more selected fields.

Signature

omit<K extends keyof T>(fields: K | readonly K[]): Exstream<Omit<T, K>, C>

Example

const safeUsers = exstream(users).omit(['passwordHash', 'resetToken'])

Parameters

fields

Type PropertyKey | readonly PropertyKey[]Required

A single key or array of keys. Missing keys are ignored. Dot paths are not traversed: 'profile.email' means a literal property with that name.

Behavior

omit() creates a shallow object using spread syntax and deletes requested keys from that copy. Enumerable own string and symbol properties are copied; the original object and nested values are not cloned or mutated. Inherited fields are not copied, even if named in fields.

It is synchronous, stable, one-to-one, context-preserving, and adds no independent buffer.

Errors

An input that cannot be checked with the in operator produces a record error. Deleting a non-configurable property does not matter because deletion occurs on the fresh ordinary copy. Existing record errors pass through.

Forms

stream.omit('password')
exstream.pipeline().omit(['password', 'token'])
exstream.omit(['password', 'token'], stream)
stream.through(exstream.omit('password'))

pick(), pluck(), map()