Skip to main content
variable pick
import { pick } from "https://deno.land/x/30_seconds_of_typescript@v1.0.1/util.ts";

Picks the key-value pairs corresponding to the given keys from an object.

Use Array.prototype.reduce() to convert the filtered/picked keys back to an object with the corresponding key-value pairs if the key exists in the object.

type

(obj: AnyObject, arr: string[]) => unknown