From 1fa2dbb7c21b65cb3d3c97595c13cbafde26ae8a Mon Sep 17 00:00:00 2001 From: NotFounds Date: Mon, 30 Aug 2021 13:05:25 +0900 Subject: [PATCH] docs(collections): fix description for single --- collections/README.md | 4 ++-- collections/single.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/collections/README.md b/collections/README.md index 52e85d654dae..11c5d4ceec7f 100644 --- a/collections/README.md +++ b/collections/README.md @@ -397,8 +397,8 @@ console.assert( ### single -Returns the only element in the given collection matching the given predicate. -Returns undefined if there is none or multiple matches for the predicate. +Returns an element if and only if that element is the only one matching the +given condition. Returns `undefined` otherwise. ```ts import { single } from "https://deno.land/std@$STD_VERSION/collections/mod.ts"; diff --git a/collections/single.ts b/collections/single.ts index fb037a2232c1..81b68cdaed0f 100644 --- a/collections/single.ts +++ b/collections/single.ts @@ -1,7 +1,7 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. /** - * Returns the only element in the given collection matching the given predicate. Returns undefined if there is none or multiple matches for the predicate. + * Returns an element if and only if that element is the only one matching the given condition. Returns `undefined` otherwise. * * Example: *