import { partitionEntries } from "https://deno.land/x/ayonli_jsext@v0.9.72/object/index.ts";
Returns a tuple of two records with the first one containing all entries of the given record that match the given predicate and the second one containing all that do not.
Examples
Example 1
Example 1
import { partitionEntries } from "@ayonli/jsext/object";
const obj = { foo: "Hello", bar: "World" };
const [match, rest] = partitionEntries(obj, ([key]) => key === "foo");
console.log(match); // { foo: "Hello" }
console.log(rest); // { bar: "World" }