From 0d7e4c99f1c5e09a3f5aff9d979a0abcde0da368 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Thu, 9 May 2024 08:49:37 +1000 Subject: [PATCH] docs(collection): finalize module documentation --- collections/mod.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/collections/mod.ts b/collections/mod.ts index e1b28f9ea699..fecb367d74bb 100644 --- a/collections/mod.ts +++ b/collections/mod.ts @@ -10,11 +10,19 @@ * package. * * ```ts - * import { intersect } from "@std/collections/intersect"; + * import { intersect, sample, pick } from "@std/collections"; + * import { assertEquals, assertArrayIncludes } from "@std/assert"; * * const lisaInterests = ["Cooking", "Music", "Hiking"]; * const kimInterests = ["Music", "Tennis", "Cooking"]; - * intersect(lisaInterests, kimInterests); // [ "Cooking", "Music" ] + * + * assertEquals(intersect(lisaInterests, kimInterests), ["Cooking", "Music"]); + * + * assertArrayIncludes(lisaInterests, [sample(lisaInterests)]); + * + * const cat = { name: "Lulu", age: 3, breed: "Ragdoll" }; + * + * assertEquals(pick(cat, ["name", "breed"]), { name: "Lulu", breed: "Ragdoll"}); * ``` * * @module