Skip to main content
Module

x/fun/record.ts>pick

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function pick
import { pick } from "https://deno.land/x/fun@v2.0.0/record.ts";

Picks specified keys from a record. Value-space implemenuation of the Pick utility type.

Examples

Example 1

import { pipe } from "./fn.ts";
import { pick } from "./record.ts";

pipe({ a: 1, b: 2, c: 3 }, pick("a", "b"))
// { a: 1, b: 2 }

Type Parameters

T extends ReadonlyRecord<unknown>
K extends keyof T

Parameters

...keys: readonly K[]

Returns

(record: T) => Pick<T, K>