From d56d807aa02d91d79f2b800d4841bc2161be1591 Mon Sep 17 00:00:00 2001 From: aleclarson Date: Wed, 24 Jul 2024 05:07:52 +0000 Subject: [PATCH 1/4] chore(release): 12.2.0-beta.83909af [skip ci] --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38a200ed5..18340c41d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add reverse argument to `castComparator` by [@aleclarson](https://github.com/aleclarson) in [1d7937e](https://github.com/radashi-org/radashi/commit/1d7937ef006139883aedac782ad032c1d6269c7a) - Add `isBoolean` function by [@aleclarson](https://github.com/aleclarson) in [adc419d](https://github.com/radashi-org/radashi/commit/adc419d5bbb1786d75619ed3d7f41a45f68c9857) - Add `noop` and `always` functions by [@aleclarson](https://github.com/aleclarson) in [eb77c8f](https://github.com/radashi-org/radashi/commit/eb77c8f004a35f1499968f6e40d01b3595384848) +- Add `similarity` function by [@aleclarson](https://github.com/aleclarson) in [#122](https://github.com/radashi-org/radashi/pull/122) + +- **(throttle)** Add `trailing` option by [@crishoj](https://github.com/crishoj) in [#127](https://github.com/radashi-org/radashi/pull/127) + +- **(throttle)** Add `trigger` method to ThrottleFunction by [@aleclarson](https://github.com/aleclarson) in [#135](https://github.com/radashi-org/radashi/pull/135) + #### Changed - **(intersects)** Let `identity` callback return any value by [@aleclarson](https://github.com/aleclarson) in [#11](https://github.com/radashi-org/radashi/pull/11) @@ -120,8 +126,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Improve the return type of `filterKey` by [@aleclarson](https://github.com/aleclarson) in [bc298c6](https://github.com/radashi-org/radashi/commit/bc298c6cfcaaf74726e1f2b901e210dea1fed641) - Handle tuples in `isArray` return type by [@aleclarson](https://github.com/aleclarson) in [9257535](https://github.com/radashi-org/radashi/commit/925753578761bda277838bf8fbbcc24b3813f2b9) - Make `select` more option-friendly by [@aleclarson](https://github.com/aleclarson) in [c9cfcd0](https://github.com/radashi-org/radashi/commit/c9cfcd0a7eb1af98682f5d9b56555162c92b7085) +- Let `shift` accept a readonly array type by [@nnmrts](https://github.com/nnmrts) in [#126](https://github.com/radashi-org/radashi/pull/126) + ### New Contributors +* [@crishoj](https://github.com/crishoj) made their first contribution in [#127](https://github.com/radashi-org/radashi/pull/127) +* [@nnmrts](https://github.com/nnmrts) made their first contribution in [#126](https://github.com/radashi-org/radashi/pull/126) * [@stefaanv](https://github.com/stefaanv) made their first contribution in [#95](https://github.com/radashi-org/radashi/pull/95) * [@eumkz](https://github.com/eumkz) made their first contribution in [#76](https://github.com/radashi-org/radashi/pull/76) * [@cimbraien](https://github.com/cimbraien) made their first contribution in [#58](https://github.com/radashi-org/radashi/pull/58) From 9e726b458affa4512cc8f58d2f35c81f3c7bf80d Mon Sep 17 00:00:00 2001 From: Alec Larson <1925840+aleclarson@users.noreply.github.com> Date: Wed, 24 Jul 2024 20:26:29 -0400 Subject: [PATCH 2/4] docs: fix headings --- docs/array/list.mdx | 2 -- docs/async/all.mdx | 4 ++-- docs/async/parallel.mdx | 2 +- docs/curry/debounce.mdx | 2 +- docs/curry/memo.mdx | 4 ++-- docs/curry/once.mdx | 2 +- docs/number/lerp.mdx | 2 +- docs/number/round.mdx | 4 ++-- docs/series/series.mdx | 2 +- 9 files changed, 11 insertions(+), 13 deletions(-) diff --git a/docs/array/list.mdx b/docs/array/list.mdx index 97e4e4769..0117056fe 100644 --- a/docs/array/list.mdx +++ b/docs/array/list.mdx @@ -26,8 +26,6 @@ _.list(0, 6, i => i, 2) // [0, 2, 4, 6] ## Signatures -The list function can do a lot with different arguments. - ### list(size) When givin a single argument, it's treated as the `size`. Returns a list with values from 0 to `size`. diff --git a/docs/async/all.mdx b/docs/async/all.mdx index 693e96c26..a20c7168c 100644 --- a/docs/async/all.mdx +++ b/docs/async/all.mdx @@ -7,7 +7,7 @@ The `all` function is similar to the builtin Promise.all or Promise.allSettled functions. Given a list (or object) of promises, if any errors are thrown, all errors are gathered and thrown in an AggregateError. -## Using an Array +### Using an Array Passing an array as an argument will return the resolved promise values as an array in the same order. @@ -21,7 +21,7 @@ const [user] = await _.all([ ]) ``` -## Using an Object +### Using an Object Passing an object as an argument will return an object with the same keys and the values as the resolved promise values. diff --git a/docs/async/parallel.mdx b/docs/async/parallel.mdx index 35dd59a28..38f4bc196 100644 --- a/docs/async/parallel.mdx +++ b/docs/async/parallel.mdx @@ -21,7 +21,7 @@ const users = await _.parallel(3, userIds, async userId => { }) ``` -## Errors +### Errors When all work is complete parallel will check for errors. If any occurred they will all be thrown in a single `AggregateError` that diff --git a/docs/curry/debounce.mdx b/docs/curry/debounce.mdx index e2bd9ddb1..d79b9c161 100644 --- a/docs/curry/debounce.mdx +++ b/docs/curry/debounce.mdx @@ -20,7 +20,7 @@ const makeSearchRequest = event => { input.addEventListener('change', _.debounce({ delay: 100 }, makeSearchRequest)) ``` -## Timing +### Timing A visual of the debounce behavior when `delay` is `100`. The debounce function returned by `debounce` can be called every millisecond but it will only call diff --git a/docs/curry/memo.mdx b/docs/curry/memo.mdx index 8976de3f1..67bbff500 100644 --- a/docs/curry/memo.mdx +++ b/docs/curry/memo.mdx @@ -18,7 +18,7 @@ const later = timestamp() now === later // => true ``` -## Expiration +### Expiration You can optionally pass a `ttl` (time to live) that will expire memoized results. In versions prior to version 10, `ttl` had a value of 300 milliseconds if not specified. @@ -40,7 +40,7 @@ now === later // => true now === muchLater // => false ``` -## Key Function +### Key Function You can optionally customize how values are stored when memoized. diff --git a/docs/curry/once.mdx b/docs/curry/once.mdx index 8dd8bce28..76175f605 100644 --- a/docs/curry/once.mdx +++ b/docs/curry/once.mdx @@ -15,7 +15,7 @@ fn() // 0.5 fn() // 0.5 ``` -## Resetting the function +### Resetting the function The `once.reset` function clears the stored result of a function that was previously wrapped with `once`. This allows the function to be executed again as if it were never called before, enabling dynamic reuse of the function with fresh computations. diff --git a/docs/number/lerp.mdx b/docs/number/lerp.mdx index fcec1206d..4b27abcd4 100644 --- a/docs/number/lerp.mdx +++ b/docs/number/lerp.mdx @@ -15,7 +15,7 @@ _.lerp(5, 15, 0.2) // => 7 _.lerp(-10, 10, 0.75) // => 5 ``` -## Etymology +### Etymology The name `lerp` is short for "linear interpolation". It's a term from computer graphics that means "interpolate linearly between two values". diff --git a/docs/number/round.mdx b/docs/number/round.mdx index 7557374da..849ccaa51 100644 --- a/docs/number/round.mdx +++ b/docs/number/round.mdx @@ -14,12 +14,12 @@ _.round(123.456) // => 123 _.round(1234.56, -2) // => 1200 ``` -## Precision +### Precision The `precision` argument is limited to be within the range of -323 to +292. Without this limit, precision values outside this range can result in NaN. -## Rounding Method +### Rounding Method You may provide a custom rounding method. The default is `Math.round`. diff --git a/docs/series/series.mdx b/docs/series/series.mdx index 36fc24977..2caa01f00 100644 --- a/docs/series/series.mdx +++ b/docs/series/series.mdx @@ -31,7 +31,7 @@ weekdays.next('friday', weekdays.first()) // => 'monday' weekdays.spin('monday', 3) // => 'thursday' ``` -## Complex Data Types +### Complex Data Types When working with objects you'll want to provide a second argument to `series`, a function that converts non-primitive values into an identity that can be checked for equality. From 3639db0c2c3c05f16a93957cc460d37742c1d95b Mon Sep 17 00:00:00 2001 From: Alec Larson <1925840+aleclarson@users.noreply.github.com> Date: Mon, 29 Jul 2024 01:42:29 +0000 Subject: [PATCH 3/4] chore: update extension recommendations --- .vscode/extensions.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 575b3d21e..982e18f79 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,7 +1,7 @@ { "recommendations": [ "vitest.explorer", - "rohit-gohri.format-code-action", - "biomejs.biome" + "biomejs.biome", + "esbenp.prettier-vscode" ] } From 3ae53da60b0345f83273aaaf0b202db35094488c Mon Sep 17 00:00:00 2001 From: Alec Larson <1925840+aleclarson@users.noreply.github.com> Date: Sun, 4 Aug 2024 19:49:19 -0400 Subject: [PATCH 4/4] chore: remove comment about structuredClone --- src/object/set.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/object/set.ts b/src/object/set.ts index 468e02c7b..180307c51 100644 --- a/src/object/set.ts +++ b/src/object/set.ts @@ -23,9 +23,6 @@ export function set( return initial } - // NOTE: One day, when structuredClone has more compatability use it - // to clone the value - // https://developer.mozilla.org/en-US/docs/Web/API/structuredClone const root: any = clone(initial) const keys = path.match(/[^.[\]]+/g) if (keys) {