Skip to content

Commit

Permalink
PR changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TGlide committed Apr 25, 2024
1 parent d1fb38d commit 5d8e414
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/runed/src/lib/functions/box/box.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function isBox(value: unknown): value is ReadableBox<unknown> {
* @returns Whether the value is a WritableBox
*/
function isWritableBox(value: unknown): value is WritableBox<unknown> {
return isBox(value) && isWritableSymbol in value;
return box.isBox(value) && isWritableSymbol in value;
}

/**
Expand Down Expand Up @@ -115,7 +115,7 @@ export type BoxFrom<T> =
*/
function boxFrom<T>(value: T): BoxFrom<T> {
if (box.isBox(value)) return value as BoxFrom<T>;
if (isFunction(value)) return boxWith(value) as BoxFrom<T>;
if (isFunction(value)) return box.with(value) as BoxFrom<T>;
return box(value) as BoxFrom<T>;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/runed/src/lib/internal/utils/is.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ export function isFunction(value: unknown): value is (...args: unknown[]) => unk
return typeof value === "function";
}

export function isObject(value: unknown): value is Record<string, unknown> {
export function isObject(value: unknown): value is Record<PropertyKey, unknown> {
return value !== null && typeof value === "object";
}
2 changes: 1 addition & 1 deletion sites/docs/content/functions/box.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Box provides several utilities to make sending and receiving reactive values eas

### `box`

Initializes boxed state
Initializes the boxed state.

```svelte
<script lang="ts">
Expand Down

0 comments on commit 5d8e414

Please sign in to comment.