@solid-primitives/utils 6.2.3 → 6.3.1
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 +112 -0
- package/dist/immutable/array.js +139 -0
- package/dist/immutable/copy.d.ts +27 -0
- package/dist/immutable/copy.js +37 -0
- package/dist/immutable/index.d.ts +6 -257
- package/dist/immutable/index.js +6 -151
- package/dist/immutable/number.d.ts +13 -0
- package/dist/immutable/number.js +37 -0
- package/dist/immutable/object.d.ts +63 -0
- package/dist/immutable/object.js +53 -0
- package/dist/immutable/types.d.ts +7 -0
- package/dist/immutable/types.js +1 -0
- package/dist/immutable/update.d.ts +30 -0
- package/dist/immutable/update.js +29 -0
- package/dist/index.d.ts +126 -0
- package/dist/index.js +213 -0
- package/dist/types.d.ts +89 -0
- package/dist/types.js +1 -0
- package/package.json +7 -14
- package/dist/chunk/R5675YMU.js +0 -139
- package/dist/immutable/index.cjs +0 -161
- package/dist/immutable/index.d.cts +0 -257
- package/dist/index/index.cjs +0 -151
- package/dist/index/index.d.cts +0 -130
- package/dist/index/index.d.ts +0 -130
- package/dist/index/index.js +0 -1
- package/dist/types-d58cbe2f.d.ts +0 -90
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
import { I as ItemsOf, g as Modify, d as Many, A as AnyClass } from '../types-d58cbe2f.js';
|
|
2
|
-
import 'solid-js';
|
|
3
|
-
|
|
4
|
-
/** make shallow copy of an array */
|
|
5
|
-
declare const shallowArrayCopy: <T>(array: readonly T[]) => T[];
|
|
6
|
-
/** make shallow copy of an object */
|
|
7
|
-
declare const shallowObjectCopy: <T extends object>(object: T) => T;
|
|
8
|
-
/** make shallow copy of an array/object */
|
|
9
|
-
declare const shallowCopy: <T extends object>(source: T) => T;
|
|
10
|
-
/**
|
|
11
|
-
* apply mutations to the an array without changing the original
|
|
12
|
-
* @param array original array
|
|
13
|
-
* @param mutator function applying mutations to the copy of source
|
|
14
|
-
* @returns changed array copy
|
|
15
|
-
*/
|
|
16
|
-
declare const withArrayCopy: <T>(array: readonly T[], mutator: (copy: T[]) => void) => T[];
|
|
17
|
-
/**
|
|
18
|
-
* apply mutations to the an object without changing the original
|
|
19
|
-
* @param object original object
|
|
20
|
-
* @param mutator function applying mutations to the copy of source
|
|
21
|
-
* @returns changed object copy
|
|
22
|
-
*/
|
|
23
|
-
declare const withObjectCopy: <T extends object>(object: T, mutator: (copy: T) => void) => T;
|
|
24
|
-
/**
|
|
25
|
-
* apply mutations to the an object/array without changing the original
|
|
26
|
-
* @param source original object
|
|
27
|
-
* @param mutator function applying mutations to the copy of source
|
|
28
|
-
* @returns changed object copy
|
|
29
|
-
*/
|
|
30
|
-
declare const withCopy: <T extends object>(source: T, mutator: (copy: T) => void) => T;
|
|
31
|
-
|
|
32
|
-
/** `a + b + c + ...` */
|
|
33
|
-
declare function add(...a: number[]): number;
|
|
34
|
-
declare function add(...a: string[]): string;
|
|
35
|
-
/** `a - b - c - ...` */
|
|
36
|
-
declare const substract: (a: number, ...b: number[]) => number;
|
|
37
|
-
/** `a * b * c * ...` */
|
|
38
|
-
declare const multiply: (a: number, ...b: number[]) => number;
|
|
39
|
-
/** `a / b / c / ...` */
|
|
40
|
-
declare const divide: (a: number, ...b: number[]) => number;
|
|
41
|
-
/** `a ** b ** c ** ...` */
|
|
42
|
-
declare const power: (a: number, ...b: number[]) => number;
|
|
43
|
-
/** clamp a number value between two other values */
|
|
44
|
-
declare const clamp: (n: number, min: number, max: number) => number;
|
|
45
|
-
|
|
46
|
-
type Predicate<T> = (item: T, index: number, array: readonly T[]) => boolean;
|
|
47
|
-
type MappingFn<T, V> = (item: T, index: number, array: readonly T[]) => V;
|
|
48
|
-
type FlattenArray<T> = T extends any[] ? FlattenArray<ItemsOf<T>> : T;
|
|
49
|
-
type ModifyValue<O, K extends keyof O, V> = Omit<O, K> & {
|
|
50
|
-
[key in K]: V;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
type UpdateSetter<O, K extends keyof O, V> = V | ((prev: O[K]) => V);
|
|
54
|
-
type Update = {
|
|
55
|
-
<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>>>>>;
|
|
56
|
-
<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], V>(object: O, k0: K0, k1: K1, k2: K2, k3: K3, setter: UpdateSetter<O[K0][K1][K2], K3, V>): ModifyValue<O, K0, ModifyValue<O[K0], K1, ModifyValue<O[K0][K1], K2, ModifyValue<O[K0][K1][K2], K3, V>>>>;
|
|
57
|
-
<O extends object, K0 extends keyof O, K1 extends keyof O[K0], K2 extends keyof O[K0][K1], V>(object: O, k0: K0, k1: K1, k2: K2, setter: UpdateSetter<O[K0][K1], K2, V>): ModifyValue<O, K0, ModifyValue<O[K0], K1, ModifyValue<O[K0][K1], K2, V>>>;
|
|
58
|
-
<O extends object, K0 extends keyof O, K1 extends keyof O[K0], V>(object: O, k0: K0, k1: K1, setter: UpdateSetter<O[K0], K1, V>): ModifyValue<O, K0, ModifyValue<O[K0], K1, V>>;
|
|
59
|
-
<O extends object, K extends keyof O, V>(object: O, key: K, setter: UpdateSetter<O, K, V>): ModifyValue<O, K, V>;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* Change single value in an object by key. Allows accessign nested objects by passing multiple keys.
|
|
63
|
-
*
|
|
64
|
-
* Performs a shallow copy of each accessed object.
|
|
65
|
-
*
|
|
66
|
-
* @param object original source
|
|
67
|
-
* @param ...keys keys of sequential accessed objects
|
|
68
|
-
* @param value a value to set in place of a previous one, or a setter function.
|
|
69
|
-
* ```ts
|
|
70
|
-
* V | ((prev: O[K]) => V)
|
|
71
|
-
* ```
|
|
72
|
-
* a new value doesn't have to have the same type as the original
|
|
73
|
-
* @returns changed copy of the original object
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* const original = { foo: { bar: { baz: 123 }}};
|
|
77
|
-
* const newObj = update(original, "foo", "bar", "baz", prev => prev + 1)
|
|
78
|
-
* original // { foo: { bar: { baz: 123 }}}
|
|
79
|
-
* newObj // { foo: { bar: { baz: 124 }}}
|
|
80
|
-
*/
|
|
81
|
-
declare const update: Update;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Create a new subset object without the provided keys
|
|
85
|
-
*
|
|
86
|
-
* @example
|
|
87
|
-
* ```ts
|
|
88
|
-
* const newObject = omit({ a:"foo", b:"bar", c: "baz" }, 'a', 'b')
|
|
89
|
-
* newObject // => { c: "baz" }
|
|
90
|
-
* ```
|
|
91
|
-
*/
|
|
92
|
-
declare const omit: <O extends object, K extends keyof O>(object: O, ...keys: K[]) => Omit<O, K>;
|
|
93
|
-
/**
|
|
94
|
-
* Create a new subset object with only the provided keys
|
|
95
|
-
*
|
|
96
|
-
* @example
|
|
97
|
-
* ```ts
|
|
98
|
-
* const newObject = pick({ a:"foo", b:"bar", c: "baz" }, 'a', 'b')
|
|
99
|
-
* newObject // => { a:"foo", b:"bar" }
|
|
100
|
-
* ```
|
|
101
|
-
*/
|
|
102
|
-
declare const pick: <O extends object, K extends keyof O>(object: O, ...keys: K[]) => Pick<O, K>;
|
|
103
|
-
/**
|
|
104
|
-
* Get a single property value of an object by specifying a path to it.
|
|
105
|
-
*/
|
|
106
|
-
declare function get<O extends object, K extends keyof O>(obj: O, key: K): O[K];
|
|
107
|
-
declare function get<O extends object, K1 extends keyof O, K2 extends keyof O[K1]>(obj: O, k1: K1, k2: K2): O[K1][K2];
|
|
108
|
-
declare function get<O extends object, K1 extends keyof O, K2 extends keyof O[K1], K3 extends keyof O[K1][K2]>(obj: O, k1: K1, k2: K2, k3: K3): O[K1][K2][K3];
|
|
109
|
-
declare function get<O extends object, K1 extends keyof O, K2 extends keyof O[K1], K3 extends keyof O[K1][K2], K4 extends keyof O[K1][K2][K3]>(obj: O, k1: K1, k2: K2, k3: K3, k4: K4): O[K1][K2][K3][K4];
|
|
110
|
-
declare function get<O extends object, K1 extends keyof O, K2 extends keyof O[K1], K3 extends keyof O[K1][K2], K4 extends keyof O[K1][K2][K3], K5 extends keyof O[K1][K2][K3][K4]>(obj: O, k1: K1, k2: K2, k3: K3, k4: K4, k5: K5): O[K1][K2][K3][K4][K5];
|
|
111
|
-
declare function get<O extends object, K1 extends keyof O, K2 extends keyof O[K1], K3 extends keyof O[K1][K2], K4 extends keyof O[K1][K2][K3], K5 extends keyof O[K1][K2][K3][K4], K6 extends keyof O[K1][K2][K3][K4][K5]>(obj: O, k1: K1, k2: K2, k3: K3, k4: K4, k5: K5, k6: K6): O[K1][K2][K3][K4][K5][K6];
|
|
112
|
-
/**
|
|
113
|
-
* Split object properties by keys into multiple object copies with a subset of selected properties.
|
|
114
|
-
*
|
|
115
|
-
* @param object original object
|
|
116
|
-
* @param ...keys keys to pick from the source, or multiple arrays of keys *(for splitting into more than 2 objects)*
|
|
117
|
-
* ```ts
|
|
118
|
-
* (keyof object)[][] | (keyof object)[]
|
|
119
|
-
* ```
|
|
120
|
-
* @returns array of subset objects
|
|
121
|
-
*/
|
|
122
|
-
declare function split<T extends object, K extends keyof T>(object: T, ...keys: K[]): [Pick<T, K>, Omit<T, K>];
|
|
123
|
-
declare function split<T extends object, K1 extends keyof T, K2 extends keyof T>(object: T, ...keys: [K1[], K2[]]): [Pick<T, K1>, Pick<T, K2>, Omit<T, K1 | K2>];
|
|
124
|
-
declare function split<T extends object, K1 extends keyof T, K2 extends keyof T, K3 extends keyof T>(object: T, ...keys: [K1[], K2[], K3[]]): [Pick<T, K1>, Pick<T, K2>, Pick<T, K3>, Omit<T, K1 | K2 | K3>];
|
|
125
|
-
declare function split<T extends object, K1 extends keyof T, K2 extends keyof T, K3 extends keyof T, K4 extends keyof T>(object: T, ...keys: [K1[], K2[], K3[], K4[]]): [Pick<T, K1>, Pick<T, K2>, Pick<T, K3>, Pick<T, K4>, Omit<T, K1 | K2 | K3 | K4>];
|
|
126
|
-
declare function split<T extends object, K1 extends keyof T, K2 extends keyof T, K3 extends keyof T, K4 extends keyof T, K5 extends keyof T>(object: T, ...keys: [K1[], K2[], K3[], K4[], K5[]]): [
|
|
127
|
-
Pick<T, K1>,
|
|
128
|
-
Pick<T, K2>,
|
|
129
|
-
Pick<T, K3>,
|
|
130
|
-
Pick<T, K4>,
|
|
131
|
-
Pick<T, K5>,
|
|
132
|
-
Omit<T, K1 | K2 | K3 | K4 | K5>
|
|
133
|
-
];
|
|
134
|
-
/**
|
|
135
|
-
* Merges multiple objects into a single one. Only the first level of properties is merged. An alternative to `{ ...a, ...b, ...c }`.
|
|
136
|
-
* @param ...objects objects to merge
|
|
137
|
-
* @example
|
|
138
|
-
* const d = merge(a, b, c)
|
|
139
|
-
*/
|
|
140
|
-
declare function merge<A extends object, B extends object>(a: A, b: B): Modify<A, B>;
|
|
141
|
-
declare function merge<A extends object, B extends object, C extends object>(a: A, b: B, c: C): Modify<Modify<A, B>, C>;
|
|
142
|
-
declare function merge<A extends object, B extends object, C extends object, D extends object>(a: A, b: B, c: C, d: D): Modify<Modify<Modify<A, B>, C>, D>;
|
|
143
|
-
declare function merge<A extends object, B extends object, C extends object, D extends object, E extends object>(a: A, b: B, c: C, d: D, e: E): Modify<Modify<Modify<Modify<A, B>, C>, D>, E>;
|
|
144
|
-
declare function merge<A extends object, B extends object, C extends object, D extends object, E extends object, F extends object>(a: A, b: B, c: C, d: D, e: E, f: F): Modify<Modify<Modify<Modify<Modify<A, B>, C>, D>, E>, F>;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* non-mutating `Array.prototype.push()`
|
|
148
|
-
* @returns changed array copy
|
|
149
|
-
*/
|
|
150
|
-
declare const push: <T>(list: readonly T[], ...items: T[]) => T[];
|
|
151
|
-
/**
|
|
152
|
-
* non-mutating function that drops n items from the array start.
|
|
153
|
-
* @returns changed array copy
|
|
154
|
-
*
|
|
155
|
-
* @example
|
|
156
|
-
* ```ts
|
|
157
|
-
* const newList = drop([1,2,3])
|
|
158
|
-
* newList // => [2,3]
|
|
159
|
-
*
|
|
160
|
-
* const newList = drop([1,2,3], 2)
|
|
161
|
-
* newList // => [3]
|
|
162
|
-
* ```
|
|
163
|
-
*/
|
|
164
|
-
declare const drop: <T>(list: T[], n?: number) => T[];
|
|
165
|
-
/**
|
|
166
|
-
* non-mutating function that drops n items from the array end.
|
|
167
|
-
* @returns changed array copy
|
|
168
|
-
*
|
|
169
|
-
* @example
|
|
170
|
-
* ```ts
|
|
171
|
-
* const newList = dropRight([1,2,3])
|
|
172
|
-
* newList // => [1,2]
|
|
173
|
-
*
|
|
174
|
-
* const newList = dropRight([1,2,3], 2)
|
|
175
|
-
* newList // => [1]
|
|
176
|
-
* ```
|
|
177
|
-
*/
|
|
178
|
-
declare const dropRight: <T>(list: T[], n?: number) => T[];
|
|
179
|
-
/**
|
|
180
|
-
* standalone `Array.prototype.filter()` that filters out passed item
|
|
181
|
-
* @returns changed array copy
|
|
182
|
-
*/
|
|
183
|
-
declare const filterOut: <T>(list: readonly T[], item: T) => T[] & {
|
|
184
|
-
removed: number;
|
|
185
|
-
};
|
|
186
|
-
/**
|
|
187
|
-
* standalone `Array.prototype.filter()`
|
|
188
|
-
* @returns changed array copy
|
|
189
|
-
*/
|
|
190
|
-
declare function filter<T>(list: readonly T[], predicate: Predicate<T>): T[] & {
|
|
191
|
-
removed: number;
|
|
192
|
-
};
|
|
193
|
-
/**
|
|
194
|
-
* non-mutating `Array.prototype.sort()` as a standalone function
|
|
195
|
-
* @returns changed array copy
|
|
196
|
-
*/
|
|
197
|
-
declare const sort: <T>(list: T[], compareFn?: ((a: T, b: T) => number) | undefined) => T[];
|
|
198
|
-
/**
|
|
199
|
-
* standalone `Array.prototype.map()` function
|
|
200
|
-
*/
|
|
201
|
-
declare const map: <T, V>(list: readonly T[], mapFn: MappingFn<T, V>) => V[];
|
|
202
|
-
/**
|
|
203
|
-
* standalone `Array.prototype.slice()` function
|
|
204
|
-
*/
|
|
205
|
-
declare const slice: <T>(list: readonly T[], start?: number, end?: number) => T[];
|
|
206
|
-
/**
|
|
207
|
-
* non-mutating `Array.prototype.splice()` as a standalone function
|
|
208
|
-
* @returns changed array copy
|
|
209
|
-
*/
|
|
210
|
-
declare const splice: <T>(list: readonly T[], start: number, deleteCount?: number, ...items: T[]) => T[];
|
|
211
|
-
/**
|
|
212
|
-
* non-mutating `Array.prototype.fill()` as a standalone function
|
|
213
|
-
* @returns changed array copy
|
|
214
|
-
*/
|
|
215
|
-
declare const fill: <T>(list: readonly T[], value: T, start?: number, end?: number) => T[];
|
|
216
|
-
/**
|
|
217
|
-
* Creates a new array concatenating array with any additional arrays and/or values.
|
|
218
|
-
* @param ...a values or arrays
|
|
219
|
-
* @returns new concatenated array
|
|
220
|
-
*/
|
|
221
|
-
declare function concat<A extends any[], V extends ItemsOf<A>>(...a: A): Array<V extends any[] ? ItemsOf<V> : V>;
|
|
222
|
-
/**
|
|
223
|
-
* Remove item from array
|
|
224
|
-
* @returns changed array copy
|
|
225
|
-
*/
|
|
226
|
-
declare const remove: <T>(list: readonly T[], item: T, ...insertItems: T[]) => T[];
|
|
227
|
-
/**
|
|
228
|
-
* Remove multiple items from an array
|
|
229
|
-
* @returns changed array copy
|
|
230
|
-
*/
|
|
231
|
-
declare const removeItems: <T>(list: readonly T[], ...items: T[]) => T[];
|
|
232
|
-
/**
|
|
233
|
-
* Flattens a nested array into a one-level array
|
|
234
|
-
* @returns changed array copy
|
|
235
|
-
*/
|
|
236
|
-
declare const flatten: <T extends any[]>(arr: T) => FlattenArray<T>[];
|
|
237
|
-
/**
|
|
238
|
-
* Sort an array by object key, or multiple keys
|
|
239
|
-
* @returns changed array copy
|
|
240
|
-
*/
|
|
241
|
-
declare const sortBy: <T>(arr: T[], ...paths: T extends object ? (Many<keyof T> | Many<(item: T) => any>)[] : Many<(item: T) => any>[]) => T[];
|
|
242
|
-
/**
|
|
243
|
-
* Returns a subset of items that are instances of provided Classes
|
|
244
|
-
* @param list list of original items
|
|
245
|
-
* @param ...classes list or classes
|
|
246
|
-
* @returns changed array copy
|
|
247
|
-
*/
|
|
248
|
-
declare const filterInstance: <T, I extends AnyClass[]>(list: readonly T[], ...classes: I) => Extract<T, InstanceType<ItemsOf<I>>>[];
|
|
249
|
-
/**
|
|
250
|
-
* Returns a subset of items that aren't instances of provided Classes
|
|
251
|
-
* @param list list of original items
|
|
252
|
-
* @param ...classes list or classes
|
|
253
|
-
* @returns changed array copy
|
|
254
|
-
*/
|
|
255
|
-
declare const filterOutInstance: <T, I extends AnyClass[]>(list: readonly T[], ...classes: I) => Exclude<T, InstanceType<ItemsOf<I>>>[];
|
|
256
|
-
|
|
257
|
-
export { FlattenArray, MappingFn, ModifyValue, Predicate, Update, UpdateSetter, add, clamp, concat, divide, drop, dropRight, fill, filter, filterInstance, filterOut, filterOutInstance, flatten, get, map, merge, multiply, omit, pick, power, push, remove, removeItems, shallowArrayCopy, shallowCopy, shallowObjectCopy, slice, sort, sortBy, splice, split, substract, update, withArrayCopy, withCopy, withObjectCopy };
|
package/dist/index/index.cjs
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var solidJs = require('solid-js');
|
|
4
|
-
var web = require('solid-js/web');
|
|
5
|
-
|
|
6
|
-
// src/index.ts
|
|
7
|
-
exports.isClient = !web.isServer;
|
|
8
|
-
exports.isDev = exports.isClient && !!solidJs.DEV;
|
|
9
|
-
exports.isProd = !exports.isDev;
|
|
10
|
-
exports.noop = () => void 0;
|
|
11
|
-
exports.trueFn = () => true;
|
|
12
|
-
exports.falseFn = () => false;
|
|
13
|
-
exports.defaultEquals = solidJs.equalFn;
|
|
14
|
-
exports.EQUALS_FALSE_OPTIONS = { equals: false };
|
|
15
|
-
exports.INTERNAL_OPTIONS = { internal: true };
|
|
16
|
-
exports.ofClass = (v, c) => v instanceof c || v && v.constructor === c;
|
|
17
|
-
function isObject(value) {
|
|
18
|
-
return value !== null && (typeof value === "object" || typeof value === "function");
|
|
19
|
-
}
|
|
20
|
-
exports.isNonNullable = (i) => i != null;
|
|
21
|
-
exports.filterNonNullable = (arr) => arr.filter(exports.isNonNullable);
|
|
22
|
-
exports.compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
23
|
-
exports.arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);
|
|
24
|
-
function chain(callbacks) {
|
|
25
|
-
return (...args) => {
|
|
26
|
-
for (const callback of callbacks)
|
|
27
|
-
callback && callback(...args);
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function reverseChain(callbacks) {
|
|
31
|
-
return (...args) => {
|
|
32
|
-
for (let i = callbacks.length - 1; i >= 0; i--) {
|
|
33
|
-
const callback = callbacks[i];
|
|
34
|
-
callback && callback(...args);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
exports.clamp = (n, min, max) => Math.min(Math.max(n, min), max);
|
|
39
|
-
exports.access = (v) => typeof v === "function" && !v.length ? v() : v;
|
|
40
|
-
exports.asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];
|
|
41
|
-
exports.accessArray = (list) => list.map((v) => exports.access(v));
|
|
42
|
-
exports.withAccess = (value, fn) => {
|
|
43
|
-
const _value = exports.access(value);
|
|
44
|
-
typeof _value != null && fn(_value);
|
|
45
|
-
};
|
|
46
|
-
exports.asAccessor = (v) => typeof v === "function" ? v : () => v;
|
|
47
|
-
function accessWith(valueOrFn, ...args) {
|
|
48
|
-
return typeof valueOrFn === "function" ? valueOrFn(...args) : valueOrFn;
|
|
49
|
-
}
|
|
50
|
-
function defer(deps, fn, initialValue) {
|
|
51
|
-
const isArray = Array.isArray(deps);
|
|
52
|
-
let prevInput;
|
|
53
|
-
let shouldDefer = true;
|
|
54
|
-
return (prevValue) => {
|
|
55
|
-
let input;
|
|
56
|
-
if (isArray) {
|
|
57
|
-
input = Array(deps.length);
|
|
58
|
-
for (let i = 0; i < deps.length; i++)
|
|
59
|
-
input[i] = deps[i]();
|
|
60
|
-
} else
|
|
61
|
-
input = deps();
|
|
62
|
-
if (shouldDefer) {
|
|
63
|
-
shouldDefer = false;
|
|
64
|
-
prevInput = input;
|
|
65
|
-
return initialValue;
|
|
66
|
-
}
|
|
67
|
-
const result = solidJs.untrack(() => fn(input, prevInput, prevValue));
|
|
68
|
-
prevInput = input;
|
|
69
|
-
return result;
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
exports.entries = Object.entries;
|
|
73
|
-
exports.keys = Object.keys;
|
|
74
|
-
exports.tryOnCleanup = exports.isDev ? (fn) => solidJs.getOwner() ? solidJs.onCleanup(fn) : fn : solidJs.onCleanup;
|
|
75
|
-
exports.createCallbackStack = () => {
|
|
76
|
-
let stack = [];
|
|
77
|
-
const clear = () => stack = [];
|
|
78
|
-
return {
|
|
79
|
-
push: (...callbacks) => stack.push(...callbacks),
|
|
80
|
-
execute(arg0, arg1, arg2, arg3) {
|
|
81
|
-
stack.forEach((cb) => cb(arg0, arg1, arg2, arg3));
|
|
82
|
-
clear();
|
|
83
|
-
},
|
|
84
|
-
clear
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
function createMicrotask(fn) {
|
|
88
|
-
let calls = 0;
|
|
89
|
-
let args;
|
|
90
|
-
solidJs.onCleanup(() => calls = 0);
|
|
91
|
-
return (...a) => {
|
|
92
|
-
args = a, calls++;
|
|
93
|
-
queueMicrotask(() => --calls === 0 && fn(...args));
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
function createHydratableSignal(serverValue, update, options) {
|
|
97
|
-
if (web.isServer) {
|
|
98
|
-
return solidJs.createSignal(serverValue, options);
|
|
99
|
-
}
|
|
100
|
-
if (solidJs.sharedConfig.context) {
|
|
101
|
-
const [state, setState] = solidJs.createSignal(serverValue, options);
|
|
102
|
-
solidJs.onMount(() => setState(() => update()));
|
|
103
|
-
return [state, setState];
|
|
104
|
-
}
|
|
105
|
-
return solidJs.createSignal(update(), options);
|
|
106
|
-
}
|
|
107
|
-
exports.createHydrateSignal = createHydratableSignal;
|
|
108
|
-
function handleDiffArray(current, prev, handleAdded, handleRemoved) {
|
|
109
|
-
const currLength = current.length;
|
|
110
|
-
const prevLength = prev.length;
|
|
111
|
-
let i = 0;
|
|
112
|
-
if (!prevLength) {
|
|
113
|
-
for (; i < currLength; i++)
|
|
114
|
-
handleAdded(current[i]);
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
if (!currLength) {
|
|
118
|
-
for (; i < prevLength; i++)
|
|
119
|
-
handleRemoved(prev[i]);
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
for (; i < prevLength; i++) {
|
|
123
|
-
if (prev[i] !== current[i])
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
let prevEl;
|
|
127
|
-
let currEl;
|
|
128
|
-
prev = prev.slice(i);
|
|
129
|
-
current = current.slice(i);
|
|
130
|
-
for (prevEl of prev) {
|
|
131
|
-
if (!current.includes(prevEl))
|
|
132
|
-
handleRemoved(prevEl);
|
|
133
|
-
}
|
|
134
|
-
for (currEl of current) {
|
|
135
|
-
if (!prev.includes(currEl))
|
|
136
|
-
handleAdded(currEl);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
Object.defineProperty(exports, 'isServer', {
|
|
141
|
-
enumerable: true,
|
|
142
|
-
get: function () { return web.isServer; }
|
|
143
|
-
});
|
|
144
|
-
exports.accessWith = accessWith;
|
|
145
|
-
exports.chain = chain;
|
|
146
|
-
exports.createHydratableSignal = createHydratableSignal;
|
|
147
|
-
exports.createMicrotask = createMicrotask;
|
|
148
|
-
exports.defer = defer;
|
|
149
|
-
exports.handleDiffArray = handleDiffArray;
|
|
150
|
-
exports.isObject = isObject;
|
|
151
|
-
exports.reverseChain = reverseChain;
|
package/dist/index/index.d.cts
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { Accessor, AccessorArray, NoInfer, EffectFunction, onCleanup, SignalOptions, createSignal } from 'solid-js';
|
|
2
|
-
export { EffectOptions, OnOptions } from 'solid-js';
|
|
3
|
-
export { isServer } from 'solid-js/web';
|
|
4
|
-
import { N as Noop, A as AnyClass, a as AnyObject, M as MaybeAccessorValue, b as MaybeAccessor, c as AnyFunction } from '../types-d58cbe2f.js';
|
|
5
|
-
export { f as AccessReturnTypes, k as AnyStatic, i as DeepPartialAny, D as Directive, E as ExtractIfPossible, m as Falsy, F as FalsyValue, I as ItemsOf, e as ItemsOfMany, d as Many, g as Modify, h as ModifyDeep, r as Narrow, s as NoInfer, j as NonIterable, O as OnAccessEffectFunction, n as Position, P as PrimitiveValue, R as RequiredKeys, S as SetterParam, p as Simplify, o as Size, T as Tail, l as Truthy, q as UnboxLazy, U as UnionToIntersection, V as Values } from '../types-d58cbe2f.js';
|
|
6
|
-
export { ResolvedChildren, ResolvedJSXElement } from 'solid-js/types/reactive/signal.js';
|
|
7
|
-
|
|
8
|
-
declare const isClient: boolean;
|
|
9
|
-
declare const isDev: boolean;
|
|
10
|
-
declare const isProd: boolean;
|
|
11
|
-
/** no operation */
|
|
12
|
-
declare const noop: Noop;
|
|
13
|
-
declare const trueFn: () => boolean;
|
|
14
|
-
declare const falseFn: () => boolean;
|
|
15
|
-
/** @deprecated use {@link equalFn} from "solid-js" */
|
|
16
|
-
declare const defaultEquals: <T>(a: T, b: T) => boolean;
|
|
17
|
-
declare const EQUALS_FALSE_OPTIONS: {
|
|
18
|
-
readonly equals: false;
|
|
19
|
-
};
|
|
20
|
-
declare const INTERNAL_OPTIONS: {
|
|
21
|
-
readonly internal: true;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Check if the value is an instance of ___
|
|
25
|
-
*/
|
|
26
|
-
declare const ofClass: (v: any, c: AnyClass) => boolean;
|
|
27
|
-
/** Check if value is typeof "object" or "function" */
|
|
28
|
-
declare function isObject(value: any): value is AnyObject;
|
|
29
|
-
declare const isNonNullable: <T>(i: T) => i is NonNullable<T>;
|
|
30
|
-
declare const filterNonNullable: <T extends readonly unknown[]>(arr: T) => NonNullable<T[number]>[];
|
|
31
|
-
declare const compare: (a: any, b: any) => number;
|
|
32
|
-
/**
|
|
33
|
-
* Check shallow array equality
|
|
34
|
-
*/
|
|
35
|
-
declare const arrayEquals: (a: readonly unknown[], b: readonly unknown[]) => boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Returns a function that will call all functions in the order they were chained with the same arguments.
|
|
38
|
-
*/
|
|
39
|
-
declare function chain<Args extends [] | any[]>(callbacks: {
|
|
40
|
-
[Symbol.iterator](): IterableIterator<((...args: Args) => any) | undefined>;
|
|
41
|
-
}): (...args: Args) => void;
|
|
42
|
-
/**
|
|
43
|
-
* Returns a function that will call all functions in the reversed order with the same arguments.
|
|
44
|
-
*/
|
|
45
|
-
declare function reverseChain<Args extends [] | any[]>(callbacks: (((...args: Args) => any) | undefined)[]): (...args: Args) => void;
|
|
46
|
-
declare const clamp: (n: number, min: number, max: number) => number;
|
|
47
|
-
/**
|
|
48
|
-
* Accesses the value of a MaybeAccessor
|
|
49
|
-
* @example
|
|
50
|
-
* ```ts
|
|
51
|
-
* access("foo") // => "foo"
|
|
52
|
-
* access(() => "foo") // => "foo"
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
declare const access: <T extends unknown>(v: T) => MaybeAccessorValue<T>;
|
|
56
|
-
declare const asArray: <T>(value: T) => (T extends any[] ? T[number] : NonNullable<T>)[];
|
|
57
|
-
/**
|
|
58
|
-
* Access an array of MaybeAccessors
|
|
59
|
-
* @example
|
|
60
|
-
* const list = [1, 2, () => 3)] // T: MaybeAccessor<number>[]
|
|
61
|
-
* const newList = accessArray(list) // T: number[]
|
|
62
|
-
*/
|
|
63
|
-
declare const accessArray: <A extends unknown>(list: readonly A[]) => MaybeAccessorValue<A>[];
|
|
64
|
-
/**
|
|
65
|
-
* Run the function if the accessed value is not `undefined` nor `null`
|
|
66
|
-
* @param value
|
|
67
|
-
* @param fn
|
|
68
|
-
*/
|
|
69
|
-
declare const withAccess: <T, A extends MaybeAccessor<T>, V = MaybeAccessorValue<A>>(value: A, fn: (value: NonNullable<V>) => void) => void;
|
|
70
|
-
declare const asAccessor: <A extends unknown>(v: A) => Accessor<MaybeAccessorValue<A>>;
|
|
71
|
-
/** If value is a function – call it with a given arguments – otherwise get the value as is */
|
|
72
|
-
declare function accessWith<T>(valueOrFn: T, ...args: T extends AnyFunction ? Parameters<T> : never): T extends AnyFunction ? ReturnType<T> : T;
|
|
73
|
-
/**
|
|
74
|
-
* Solid's `on` helper, but always defers and returns a provided initial value when if does instead of `undefined`.
|
|
75
|
-
*
|
|
76
|
-
* @param deps
|
|
77
|
-
* @param fn
|
|
78
|
-
* @param initialValue
|
|
79
|
-
*/
|
|
80
|
-
declare function defer<S, Next extends Prev, Prev = Next>(deps: AccessorArray<S> | Accessor<S>, fn: (input: S, prevInput: S, prev: undefined | NoInfer<Prev>) => Next, initialValue: Next): EffectFunction<undefined | NoInfer<Next>, NoInfer<Next>>;
|
|
81
|
-
declare function defer<S, Next extends Prev, Prev = Next>(deps: AccessorArray<S> | Accessor<S>, fn: (input: S, prevInput: S, prev: undefined | NoInfer<Prev>) => Next, initialValue?: undefined): EffectFunction<undefined | NoInfer<Next>>;
|
|
82
|
-
/**
|
|
83
|
-
* Get entries of an object
|
|
84
|
-
*/
|
|
85
|
-
declare const entries: <T extends object>(obj: T) => [keyof T, T[keyof T]][];
|
|
86
|
-
/**
|
|
87
|
-
* Get keys of an object
|
|
88
|
-
*/
|
|
89
|
-
declare const keys: <T extends object>(object: T) => (keyof T)[];
|
|
90
|
-
/**
|
|
91
|
-
* Solid's `onCleanup` that doesn't warn in development if used outside of a component.
|
|
92
|
-
*/
|
|
93
|
-
declare const tryOnCleanup: typeof onCleanup;
|
|
94
|
-
declare const createCallbackStack: <A0 = void, A1 = void, A2 = void, A3 = void>() => {
|
|
95
|
-
push: (...callbacks: ((arg0: A0, arg1: A1, arg2: A2, arg3: A3) => void)[]) => void;
|
|
96
|
-
execute: (arg0: A0, arg1: A1, arg2: A2, arg3: A3) => void;
|
|
97
|
-
clear: VoidFunction;
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
* Group synchronous function calls.
|
|
101
|
-
* @param fn
|
|
102
|
-
* @returns `fn`
|
|
103
|
-
*/
|
|
104
|
-
declare function createMicrotask<A extends any[] | []>(fn: (...a: A) => void): (...a: A) => void;
|
|
105
|
-
/**
|
|
106
|
-
* A hydratable version of the {@link createSignal}. It will use the serverValue on the server and the update function on the client. If initialized during hydration it will use serverValue as the initial value and update it once hydration is complete.
|
|
107
|
-
*
|
|
108
|
-
* @param serverValue initial value of the state on the server
|
|
109
|
-
* @param update called once on the client or on hydration to initialize the value
|
|
110
|
-
* @param options {@link SignalOptions}
|
|
111
|
-
* @returns
|
|
112
|
-
* ```ts
|
|
113
|
-
* [state: Accessor<T>, setState: Setter<T>]
|
|
114
|
-
* ```
|
|
115
|
-
* @see {@link createSignal}
|
|
116
|
-
*/
|
|
117
|
-
declare function createHydratableSignal<T>(serverValue: T, update: () => T, options?: SignalOptions<T>): ReturnType<typeof createSignal<T>>;
|
|
118
|
-
/** @deprecated use {@link createHydratableSignal} instead */
|
|
119
|
-
declare const createHydrateSignal: typeof createHydratableSignal;
|
|
120
|
-
/**
|
|
121
|
-
* Handle items removed and added to the array by diffing it by refference.
|
|
122
|
-
*
|
|
123
|
-
* @param current new array instance
|
|
124
|
-
* @param prev previous array copy
|
|
125
|
-
* @param handleAdded called once for every added item to array
|
|
126
|
-
* @param handleRemoved called once for every removed from array
|
|
127
|
-
*/
|
|
128
|
-
declare function handleDiffArray<T>(current: readonly T[], prev: readonly T[], handleAdded: (item: T) => void, handleRemoved: (item: T) => void): void;
|
|
129
|
-
|
|
130
|
-
export { AnyClass, AnyFunction, AnyObject, EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, MaybeAccessor, MaybeAccessorValue, Noop, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };
|
package/dist/index/index.d.ts
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { Accessor, AccessorArray, NoInfer, EffectFunction, onCleanup, SignalOptions, createSignal } from 'solid-js';
|
|
2
|
-
export { EffectOptions, OnOptions } from 'solid-js';
|
|
3
|
-
export { isServer } from 'solid-js/web';
|
|
4
|
-
import { N as Noop, A as AnyClass, a as AnyObject, M as MaybeAccessorValue, b as MaybeAccessor, c as AnyFunction } from '../types-d58cbe2f.js';
|
|
5
|
-
export { f as AccessReturnTypes, k as AnyStatic, i as DeepPartialAny, D as Directive, E as ExtractIfPossible, m as Falsy, F as FalsyValue, I as ItemsOf, e as ItemsOfMany, d as Many, g as Modify, h as ModifyDeep, r as Narrow, s as NoInfer, j as NonIterable, O as OnAccessEffectFunction, n as Position, P as PrimitiveValue, R as RequiredKeys, S as SetterParam, p as Simplify, o as Size, T as Tail, l as Truthy, q as UnboxLazy, U as UnionToIntersection, V as Values } from '../types-d58cbe2f.js';
|
|
6
|
-
export { ResolvedChildren, ResolvedJSXElement } from 'solid-js/types/reactive/signal.js';
|
|
7
|
-
|
|
8
|
-
declare const isClient: boolean;
|
|
9
|
-
declare const isDev: boolean;
|
|
10
|
-
declare const isProd: boolean;
|
|
11
|
-
/** no operation */
|
|
12
|
-
declare const noop: Noop;
|
|
13
|
-
declare const trueFn: () => boolean;
|
|
14
|
-
declare const falseFn: () => boolean;
|
|
15
|
-
/** @deprecated use {@link equalFn} from "solid-js" */
|
|
16
|
-
declare const defaultEquals: <T>(a: T, b: T) => boolean;
|
|
17
|
-
declare const EQUALS_FALSE_OPTIONS: {
|
|
18
|
-
readonly equals: false;
|
|
19
|
-
};
|
|
20
|
-
declare const INTERNAL_OPTIONS: {
|
|
21
|
-
readonly internal: true;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Check if the value is an instance of ___
|
|
25
|
-
*/
|
|
26
|
-
declare const ofClass: (v: any, c: AnyClass) => boolean;
|
|
27
|
-
/** Check if value is typeof "object" or "function" */
|
|
28
|
-
declare function isObject(value: any): value is AnyObject;
|
|
29
|
-
declare const isNonNullable: <T>(i: T) => i is NonNullable<T>;
|
|
30
|
-
declare const filterNonNullable: <T extends readonly unknown[]>(arr: T) => NonNullable<T[number]>[];
|
|
31
|
-
declare const compare: (a: any, b: any) => number;
|
|
32
|
-
/**
|
|
33
|
-
* Check shallow array equality
|
|
34
|
-
*/
|
|
35
|
-
declare const arrayEquals: (a: readonly unknown[], b: readonly unknown[]) => boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Returns a function that will call all functions in the order they were chained with the same arguments.
|
|
38
|
-
*/
|
|
39
|
-
declare function chain<Args extends [] | any[]>(callbacks: {
|
|
40
|
-
[Symbol.iterator](): IterableIterator<((...args: Args) => any) | undefined>;
|
|
41
|
-
}): (...args: Args) => void;
|
|
42
|
-
/**
|
|
43
|
-
* Returns a function that will call all functions in the reversed order with the same arguments.
|
|
44
|
-
*/
|
|
45
|
-
declare function reverseChain<Args extends [] | any[]>(callbacks: (((...args: Args) => any) | undefined)[]): (...args: Args) => void;
|
|
46
|
-
declare const clamp: (n: number, min: number, max: number) => number;
|
|
47
|
-
/**
|
|
48
|
-
* Accesses the value of a MaybeAccessor
|
|
49
|
-
* @example
|
|
50
|
-
* ```ts
|
|
51
|
-
* access("foo") // => "foo"
|
|
52
|
-
* access(() => "foo") // => "foo"
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
declare const access: <T extends unknown>(v: T) => MaybeAccessorValue<T>;
|
|
56
|
-
declare const asArray: <T>(value: T) => (T extends any[] ? T[number] : NonNullable<T>)[];
|
|
57
|
-
/**
|
|
58
|
-
* Access an array of MaybeAccessors
|
|
59
|
-
* @example
|
|
60
|
-
* const list = [1, 2, () => 3)] // T: MaybeAccessor<number>[]
|
|
61
|
-
* const newList = accessArray(list) // T: number[]
|
|
62
|
-
*/
|
|
63
|
-
declare const accessArray: <A extends unknown>(list: readonly A[]) => MaybeAccessorValue<A>[];
|
|
64
|
-
/**
|
|
65
|
-
* Run the function if the accessed value is not `undefined` nor `null`
|
|
66
|
-
* @param value
|
|
67
|
-
* @param fn
|
|
68
|
-
*/
|
|
69
|
-
declare const withAccess: <T, A extends MaybeAccessor<T>, V = MaybeAccessorValue<A>>(value: A, fn: (value: NonNullable<V>) => void) => void;
|
|
70
|
-
declare const asAccessor: <A extends unknown>(v: A) => Accessor<MaybeAccessorValue<A>>;
|
|
71
|
-
/** If value is a function – call it with a given arguments – otherwise get the value as is */
|
|
72
|
-
declare function accessWith<T>(valueOrFn: T, ...args: T extends AnyFunction ? Parameters<T> : never): T extends AnyFunction ? ReturnType<T> : T;
|
|
73
|
-
/**
|
|
74
|
-
* Solid's `on` helper, but always defers and returns a provided initial value when if does instead of `undefined`.
|
|
75
|
-
*
|
|
76
|
-
* @param deps
|
|
77
|
-
* @param fn
|
|
78
|
-
* @param initialValue
|
|
79
|
-
*/
|
|
80
|
-
declare function defer<S, Next extends Prev, Prev = Next>(deps: AccessorArray<S> | Accessor<S>, fn: (input: S, prevInput: S, prev: undefined | NoInfer<Prev>) => Next, initialValue: Next): EffectFunction<undefined | NoInfer<Next>, NoInfer<Next>>;
|
|
81
|
-
declare function defer<S, Next extends Prev, Prev = Next>(deps: AccessorArray<S> | Accessor<S>, fn: (input: S, prevInput: S, prev: undefined | NoInfer<Prev>) => Next, initialValue?: undefined): EffectFunction<undefined | NoInfer<Next>>;
|
|
82
|
-
/**
|
|
83
|
-
* Get entries of an object
|
|
84
|
-
*/
|
|
85
|
-
declare const entries: <T extends object>(obj: T) => [keyof T, T[keyof T]][];
|
|
86
|
-
/**
|
|
87
|
-
* Get keys of an object
|
|
88
|
-
*/
|
|
89
|
-
declare const keys: <T extends object>(object: T) => (keyof T)[];
|
|
90
|
-
/**
|
|
91
|
-
* Solid's `onCleanup` that doesn't warn in development if used outside of a component.
|
|
92
|
-
*/
|
|
93
|
-
declare const tryOnCleanup: typeof onCleanup;
|
|
94
|
-
declare const createCallbackStack: <A0 = void, A1 = void, A2 = void, A3 = void>() => {
|
|
95
|
-
push: (...callbacks: ((arg0: A0, arg1: A1, arg2: A2, arg3: A3) => void)[]) => void;
|
|
96
|
-
execute: (arg0: A0, arg1: A1, arg2: A2, arg3: A3) => void;
|
|
97
|
-
clear: VoidFunction;
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
* Group synchronous function calls.
|
|
101
|
-
* @param fn
|
|
102
|
-
* @returns `fn`
|
|
103
|
-
*/
|
|
104
|
-
declare function createMicrotask<A extends any[] | []>(fn: (...a: A) => void): (...a: A) => void;
|
|
105
|
-
/**
|
|
106
|
-
* A hydratable version of the {@link createSignal}. It will use the serverValue on the server and the update function on the client. If initialized during hydration it will use serverValue as the initial value and update it once hydration is complete.
|
|
107
|
-
*
|
|
108
|
-
* @param serverValue initial value of the state on the server
|
|
109
|
-
* @param update called once on the client or on hydration to initialize the value
|
|
110
|
-
* @param options {@link SignalOptions}
|
|
111
|
-
* @returns
|
|
112
|
-
* ```ts
|
|
113
|
-
* [state: Accessor<T>, setState: Setter<T>]
|
|
114
|
-
* ```
|
|
115
|
-
* @see {@link createSignal}
|
|
116
|
-
*/
|
|
117
|
-
declare function createHydratableSignal<T>(serverValue: T, update: () => T, options?: SignalOptions<T>): ReturnType<typeof createSignal<T>>;
|
|
118
|
-
/** @deprecated use {@link createHydratableSignal} instead */
|
|
119
|
-
declare const createHydrateSignal: typeof createHydratableSignal;
|
|
120
|
-
/**
|
|
121
|
-
* Handle items removed and added to the array by diffing it by refference.
|
|
122
|
-
*
|
|
123
|
-
* @param current new array instance
|
|
124
|
-
* @param prev previous array copy
|
|
125
|
-
* @param handleAdded called once for every added item to array
|
|
126
|
-
* @param handleRemoved called once for every removed from array
|
|
127
|
-
*/
|
|
128
|
-
declare function handleDiffArray<T>(current: readonly T[], prev: readonly T[], handleAdded: (item: T) => void, handleRemoved: (item: T) => void): void;
|
|
129
|
-
|
|
130
|
-
export { AnyClass, AnyFunction, AnyObject, EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, MaybeAccessor, MaybeAccessorValue, Noop, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };
|
package/dist/index/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, isServer, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess } from '../chunk/R5675YMU.js';
|