Module

x/rambda/rambda.js>pick

Faster and smaller alternative to Ramda
Latest
function pick
import { pick } from "https://dotland.deno.dev/x/rambda@9.4.1/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