From 59e6a87477eccf4842d55c98444e6aa3ac8c3208 Mon Sep 17 00:00:00 2001 From: hw Date: Sun, 14 Apr 2024 13:30:16 +0900 Subject: [PATCH] docs: fix flat args ordering (#265) --- src/Lazy/flat.ts | 2 +- src/Lazy/fx.ts | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Lazy/flat.ts b/src/Lazy/flat.ts index 4e37ab58..384d2ce4 100644 --- a/src/Lazy/flat.ts +++ b/src/Lazy/flat.ts @@ -203,7 +203,7 @@ function async( /** * Returns flattened Iterable/AsyncIterable. - * If first argument is number, more perform flatten `flat(2, [[[1,2]]]) // [1,2]` + * If first argument is number, more perform flatten `flat([[[1,2]]], 2) // [1,2]` * * @example * ```ts diff --git a/src/Lazy/fx.ts b/src/Lazy/fx.ts index 8a38b089..646dd04c 100644 --- a/src/Lazy/fx.ts +++ b/src/Lazy/fx.ts @@ -60,7 +60,14 @@ class FxAsyncIterable { /** * Returns flattened AsyncIterable. - * If first argument is number, more perform flatten `flat(2, [[[1,2]]]) // [1,2]` + * If first argument is number, more perform flatten + * + * @example + * ``` + * await fx([[1],[[2]]]) + * .toAsync() + * .flat(2).toArray(); // [1,2] + * ``` * * see {@link https://fxts.dev/docs/flat | flat} */ @@ -312,7 +319,10 @@ export class FxIterable { /** * Returns flattened Iterable. - * If first argument is number, more perform flatten `flat(2, [[[1,2]]]) // [1,2]` + * If first argument is number, more perform flatten + * + * @example + * `fx([[1],[[2]]]).flat(2).toArray(); // [1,2]` * * see {@link https://fxts.dev/docs/flat | flat} */