From 3bcc297a56ac965858c37e715bd6bae3159e7281 Mon Sep 17 00:00:00 2001 From: Alec Larson <1925840+aleclarson@users.noreply.github.com> Date: Sun, 1 Dec 2024 10:57:57 -0500 Subject: [PATCH] docs: add version metadata --- docs/array/cartesianProduct.mdx | 1 + docs/async/parallel.mdx | 2 +- docs/async/retry.mdx | 2 +- docs/typed/isClass.mdx | 1 + docs/typed/isUndefined.mdx | 1 + src/array/cartesianProduct.ts | 1 + src/typed/isClass.ts | 1 + src/typed/isUndefined.ts | 1 + 8 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/array/cartesianProduct.mdx b/docs/array/cartesianProduct.mdx index 75250464..4fc20192 100644 --- a/docs/array/cartesianProduct.mdx +++ b/docs/array/cartesianProduct.mdx @@ -1,6 +1,7 @@ --- title: cartesianProduct description: Perform a Cartesian product of arrays +since: 12.3.0 --- ### Usage diff --git a/docs/async/parallel.mdx b/docs/async/parallel.mdx index 9899ca18..d2f63bb9 100644 --- a/docs/async/parallel.mdx +++ b/docs/async/parallel.mdx @@ -22,7 +22,7 @@ const users = await _.parallel(3, userIds, async userId => { ### Interrupting -Processing can be manually interrupted. Pass an `AbortController.signal` via the `signal` option. When the signal is aborted, no more calls to your callback will be made. Any in-progress calls will continue to completion, unless you manually connect the signal inside your callback. In other words, `parallel` is only responsible for aborting the array loop, not the async operations themselves. +Since v12.3.0, processing can be manually interrupted. Pass an `AbortController.signal` via the `signal` option. When the signal is aborted, no more calls to your callback will be made. Any in-progress calls will continue to completion, unless you manually connect the signal inside your callback. In other words, `parallel` is only responsible for aborting the array loop, not the async operations themselves. When `parallel` is interrupted by the signal, it throws a `DOMException` (even in Node.js) with the message `This operation was aborted` and name `AbortError`. diff --git a/docs/async/retry.mdx b/docs/async/retry.mdx index d115fc49..0d2431d0 100644 --- a/docs/async/retry.mdx +++ b/docs/async/retry.mdx @@ -14,7 +14,7 @@ The `retry` function runs an async function and retries it if it fails. You can - `delay` is milliseconds to sleep between retries - `backoff` is a function called to calculate the delay between retries - It receives the attempt number (starting with `1`) and returns the delay in milliseconds. -- `signal` allows you to pass an `AbortController.signal` to interrupt the retry operation +- `signal` (v12.3.0+) allows you to pass an `AbortController.signal` to interrupt the retry operation ```ts import * as _ from 'radashi' diff --git a/docs/typed/isClass.mdx b/docs/typed/isClass.mdx index f1997fef..ccc6e89d 100644 --- a/docs/typed/isClass.mdx +++ b/docs/typed/isClass.mdx @@ -1,6 +1,7 @@ --- title: isClass description: Determine if a value was declared with `class` syntax +since: 12.3.0 --- ### Usage diff --git a/docs/typed/isUndefined.mdx b/docs/typed/isUndefined.mdx index dcad9955..47b19e65 100644 --- a/docs/typed/isUndefined.mdx +++ b/docs/typed/isUndefined.mdx @@ -1,6 +1,7 @@ --- title: isUndefined description: 'Determine if a value is undefined' +since: 12.3.0 --- ### Usage diff --git a/src/array/cartesianProduct.ts b/src/array/cartesianProduct.ts index 4a3b8bb8..28d66279 100644 --- a/src/array/cartesianProduct.ts +++ b/src/array/cartesianProduct.ts @@ -23,6 +23,7 @@ type ReadonlyArray2D = readonly (readonly T[])[] * // ['blue', 'small', 'slow'] * // ] * ``` + * @version 12.3.0 */ export function cartesianProduct>( ...arrays: [...T] diff --git a/src/typed/isClass.ts b/src/typed/isClass.ts index 89cf5d43..c6eac327 100644 --- a/src/typed/isClass.ts +++ b/src/typed/isClass.ts @@ -13,6 +13,7 @@ import { isFunction, type Class, type StrictExtract } from 'radashi' * isClass('abc') // => false * isClass({}) // => false * ``` + * @version 12.3.0 */ export function isClass(value: T): value is ExtractClass { return ( diff --git a/src/typed/isUndefined.ts b/src/typed/isUndefined.ts index c6d3a25c..b1c77aa8 100644 --- a/src/typed/isUndefined.ts +++ b/src/typed/isUndefined.ts @@ -7,6 +7,7 @@ * isUndefined(undefined) // => true * isUndefined(null) // => false * ``` + * @version 12.3.0 */ export function isUndefined(value: unknown): value is undefined { return typeof value === 'undefined'