Package: effect
Module: Struct
Creates a new struct with the specified keys removed.
When to use
Use to exclude sensitive or irrelevant fields from a struct.
Gotchas
Keys not present in the struct are silently ignored.
Example (Removing a property)
import { pipe, Struct } from "effect"
const user = { name: "Alice", age: 30, password: "secret" }
const safe = pipe(user, Struct.omit(["password"]))
console.log(safe) // { name: "Alice", age: 30 }
See
pick – the inverse (keep only specified keys)Signature
declare const omit: { <S extends object, const Keys extends ReadonlyArray<keyof S>>(keys: Keys): (self: S) => Simplify<Omit<S, Keys[number]>>; <S extends object, const Keys extends ReadonlyArray<keyof S>>(self: S, keys: Keys): Simplify<Omit<S, Keys[number]>>; }
Since v2.0.0