@solid-primitives/utils 6.3.1 → 6.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/immutable/array.d.ts +2 -2
- package/dist/immutable/object.d.ts +1 -1
- package/dist/immutable/object.js +1 -0
- package/dist/immutable/types.d.ts +1 -1
- package/dist/immutable/types.js +1 -1
- package/dist/immutable/update.d.ts +1 -1
- package/dist/immutable/update.js +1 -0
- package/dist/index.d.ts +3 -3
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyClass, ItemsOf, Many } from "../index.js";
|
|
2
|
-
import { FlattenArray, MappingFn, Predicate } from "./types.js";
|
|
1
|
+
import { type AnyClass, type ItemsOf, type Many } from "../index.js";
|
|
2
|
+
import type { FlattenArray, MappingFn, Predicate } from "./types.js";
|
|
3
3
|
/**
|
|
4
4
|
* non-mutating `Array.prototype.push()`
|
|
5
5
|
* @returns changed array copy
|
package/dist/immutable/object.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ItemsOf } from "../index.js";
|
|
1
|
+
import { type ItemsOf } from "../index.js";
|
|
2
2
|
export type Predicate<T> = (item: T, index: number, array: readonly T[]) => boolean;
|
|
3
3
|
export type MappingFn<T, V> = (item: T, index: number, array: readonly T[]) => V;
|
|
4
4
|
export type FlattenArray<T> = T extends any[] ? FlattenArray<ItemsOf<T>> : T;
|
package/dist/immutable/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import {} from "../index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModifyValue } from "./types.js";
|
|
1
|
+
import { type ModifyValue } from "./types.js";
|
|
2
2
|
export type UpdateSetter<O, K extends keyof O, V> = V | ((prev: O[K]) => V);
|
|
3
3
|
export type Update = {
|
|
4
4
|
<O extends object, K0 extends keyof O, K1 extends keyof O[K0], K2 extends keyof O[K0][K1], K3 extends keyof O[K0][K1][K2], K4 extends keyof O[K0][K1][K2][K3], V>(object: O, k0: K0, k1: K1, k2: K2, k3: K3, k4: K4, setter: UpdateSetter<O[K0][K1][K2][K3], K4, V>): ModifyValue<O, K0, ModifyValue<O[K0], K1, ModifyValue<O[K0][K1], K2, ModifyValue<O[K0][K1][K2], K3, ModifyValue<O[K0][K1][K2][K3], K4, V>>>>>;
|
package/dist/immutable/update.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { onCleanup, createSignal, Accessor, AccessorArray, EffectFunction, NoInfer, SignalOptions } from "solid-js";
|
|
1
|
+
import { onCleanup, createSignal, type Accessor, type AccessorArray, type EffectFunction, type NoInfer, type SignalOptions } from "solid-js";
|
|
2
2
|
import { isServer } from "solid-js/web";
|
|
3
3
|
import type { AnyClass, MaybeAccessor, MaybeAccessorValue, Noop, AnyObject, AnyFunction } from "./types.js";
|
|
4
4
|
export * from "./types.js";
|
|
@@ -50,7 +50,7 @@ export declare const clamp: (n: number, min: number, max: number) => number;
|
|
|
50
50
|
* access(() => "foo") // => "foo"
|
|
51
51
|
* ```
|
|
52
52
|
*/
|
|
53
|
-
export declare const access: <T extends
|
|
53
|
+
export declare const access: <T extends MaybeAccessor<any>>(v: T) => MaybeAccessorValue<T>;
|
|
54
54
|
export declare const asArray: <T>(value: T) => (T extends any[] ? T[number] : NonNullable<T>)[];
|
|
55
55
|
/**
|
|
56
56
|
* Access an array of MaybeAccessors
|
|
@@ -58,7 +58,7 @@ export declare const asArray: <T>(value: T) => (T extends any[] ? T[number] : No
|
|
|
58
58
|
* const list = [1, 2, () => 3)] // T: MaybeAccessor<number>[]
|
|
59
59
|
* const newList = accessArray(list) // T: number[]
|
|
60
60
|
*/
|
|
61
|
-
export declare const accessArray: <A extends
|
|
61
|
+
export declare const accessArray: <A extends MaybeAccessor<any>>(list: readonly A[]) => MaybeAccessorValue<A>[];
|
|
62
62
|
/**
|
|
63
63
|
* Run the function if the accessed value is not `undefined` nor `null`
|
|
64
64
|
* @param value
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solid-primitives/utils",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.2",
|
|
4
4
|
"description": "A bunch of reactive utility types and functions, for building primitives with Solid.js",
|
|
5
5
|
"author": "Damian Tarnawski @thetarnav <gthetarnav@gmail.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
"solid-js": "^1.6.12"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"solid-js": "^1.
|
|
60
|
+
"solid-js": "^1.9.7"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
|
-
"dev": "
|
|
64
|
-
"build": "
|
|
63
|
+
"dev": "node --import=@nothing-but/node-resolve-ts --experimental-transform-types ../../scripts/dev.ts",
|
|
64
|
+
"build": "node --import=@nothing-but/node-resolve-ts --experimental-transform-types ../../scripts/build.ts",
|
|
65
65
|
"vitest": "vitest -c ../../configs/vitest.config.ts",
|
|
66
66
|
"test": "pnpm run vitest",
|
|
67
67
|
"test:ssr": "pnpm run vitest --mode ssr"
|