Skip to main content
Module

x/rambda/index.d.ts>pick

Faster and smaller alternative to Ramda
Go to Latest
function pick
import { pick } from "https://deno.land/x/rambda@v7.0.1/index.d.ts";

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

input can be either an object or an array.

String anotation 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