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

Retrieve a set of properties indicated by the given selectors(string[]) from an object.

Use Array.prototype.map() for each selector, String.prototype.replace() to replace square brackets with dots, String.prototype.split('.') to split each selector, Array.prototype.filter() to remove empty values and Array.prototype.reduce() to get the value indicated by it.

type

(from: any, ...selectors: string[]) => unknown