Module

x/rambda/mod.ts>pick

Faster and smaller alternative to Ramda
Go to Latest
function pick
import { pick } from "https://dotland.deno.dev/x/rambda@v9.2.0/mod.ts";

It returns a partial copy of an input containing only propsToPick properties.

input can be either an object or an array.

String annotation of propsToPick is one of the differences between Rambda and Ramda.

Type Parameters

T
K extends string | number | symbol

Parameters

propsToPick: K[]
input: T

Returns

Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>

Type Parameters

K extends string | number | symbol

Parameters

propsToPick: K[]

Returns

<T>(input: T) => Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>

Parameters

propsToPick: string
input: T

Parameters

propsToPick: string

Returns

(input: T) => U

Parameters

propsToPick: string
input: object

Parameters

propsToPick: string

Returns

(input: object) => T