omit
Omit unwanted attributes from an object
106 bytes
Usage
Given an object and a list of keys in the object, returns a new object without any of the given keys.
import * as import _
_ from 'radashi'
const const fish: { name: string; weight: number; source: string; brackish: boolean;}
fish = { name: string
name: 'Bass', weight: number
weight: 8, source: string
source: 'lake', brackish: boolean
brackish: false,}
import _
_.omit<{ name: string; weight: number; source: string; brackish: boolean;}, "name" | "source">(obj: { name: string; weight: number; source: string; brackish: boolean;}, keys: readonly ("name" | "source")[]): Omit<...>export omit
Omit a list of properties from an object returning a new object
with the properties that remain.
omit(const fish: { name: string; weight: number; source: string; brackish: boolean;}
fish, ['name', 'source']) // => { weight, brackish }