@solid-primitives/utils 6.3.0 → 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.
@@ -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
@@ -1,4 +1,4 @@
1
- import { Modify } from "../index.js";
1
+ import { type Modify } from "../index.js";
2
2
  /**
3
3
  * Create a new subset object without the provided keys
4
4
  *
@@ -1,4 +1,5 @@
1
1
  import { withObjectCopy, shallowObjectCopy } from "./copy.js";
2
+ import {} from "../index.js";
2
3
  /**
3
4
  * Create a new subset object without the provided keys
4
5
  *
@@ -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;
@@ -1 +1 @@
1
- export {};
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>>>>>;
@@ -1,4 +1,5 @@
1
1
  import { withCopy } from "./copy.js";
2
+ import {} from "./types.js";
2
3
  /**
3
4
  * Change single value in an object by key. Allows accessign nested objects by passing multiple keys.
4
5
  *
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 unknown>(v: T) => MaybeAccessorValue<T>;
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 unknown>(list: readonly A[]) => MaybeAccessorValue<A>[];
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.0",
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": [
@@ -26,15 +26,15 @@
26
26
  "browser": {},
27
27
  "exports": {
28
28
  ".": {
29
- "@solid-primitives/source": "./src/index.ts",
30
29
  "import": {
30
+ "@solid-primitives/source": "./src/index.ts",
31
31
  "types": "./dist/index.d.ts",
32
32
  "default": "./dist/index.js"
33
33
  }
34
34
  },
35
35
  "./immutable": {
36
- "@solid-primitives/source": "./src/immutable/index.ts",
37
36
  "import": {
37
+ "@solid-primitives/source": "./src/immutable/index.ts",
38
38
  "types": "./dist/immutable/index.d.ts",
39
39
  "default": "./dist/immutable/index.js"
40
40
  }
@@ -57,11 +57,11 @@
57
57
  "solid-js": "^1.6.12"
58
58
  },
59
59
  "devDependencies": {
60
- "solid-js": "^1.8.7"
60
+ "solid-js": "^1.9.7"
61
61
  },
62
62
  "scripts": {
63
- "dev": "tsx ../../scripts/dev.ts",
64
- "build": "tsx ../../scripts/build.ts",
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"