From 7df606e789659f79a2332f4c3dc788290a484eee Mon Sep 17 00:00:00 2001 From: Sergey Slipchenko Date: Thu, 8 Feb 2024 07:46:21 +0400 Subject: [PATCH] fix: improve Result jsdoc comments --- src/result.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/result.ts b/src/result.ts index 37186e8..513370e 100644 --- a/src/result.ts +++ b/src/result.ts @@ -15,19 +15,24 @@ export class Result { } /** - * Represents a failure + * Create a box representing failure */ static Err(err: E) { return new Result({ isOk: false, err }); } /** - * Represents a success + * Create a box representing success */ static Ok(value: T) { return new Result({ isOk: true, value }); } + /** + * Combine record of boxes and return either record with their unboxed values + * if all boxes represent a success or the first box representing failure + * otherwise + */ static all>>>( xs: T, ): Result<