Skip to content

Commit

Permalink
Merge branch 'radashi-org:main' into narrow-return-type-for-draw
Browse files Browse the repository at this point in the history
  • Loading branch information
crishoj authored Aug 6, 2024
2 parents f21f590 + 3ae53da commit 4c974af
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"recommendations": [
"vitest.explorer",
"rohit-gohri.format-code-action",
"biomejs.biome"
"biomejs.biome",
"esbenp.prettier-vscode"
]
}
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)


#### <!-- 05 -->Changed
- **(intersects)** Let `identity` callback return any value by [@aleclarson](https://github.com/aleclarson) in [#11](https://github.com/radashi-org/radashi/pull/11)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions docs/array/list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
4 changes: 2 additions & 2 deletions docs/async/all.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion docs/async/parallel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/curry/debounce.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/curry/memo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -40,7 +40,7 @@ now === later // => true
now === muchLater // => false
```

## Key Function
### Key Function

You can optionally customize how values are stored when memoized.

Expand Down
2 changes: 1 addition & 1 deletion docs/curry/once.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion docs/number/lerp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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".

Expand Down
4 changes: 2 additions & 2 deletions docs/number/round.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
2 changes: 1 addition & 1 deletion docs/series/series.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
3 changes: 0 additions & 3 deletions src/object/set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ export function set<T extends object, K>(
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) {
Expand Down

0 comments on commit 4c974af

Please sign in to comment.