Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rambda/rambda.js>pick

Faster and smaller alternative to Ramda
Go to Latest
function pick
import { pick } from "https://deno.land/x/rambda@9.3.0/rambda.js";

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