@solid-primitives/utils 3.0.2 → 4.0.0
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/index.cjs +40 -133
- package/dist/index.d.ts +2 -70
- package/dist/index.js +7 -83
- package/package.json +21 -14
package/dist/index.cjs
CHANGED
|
@@ -1,65 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var solidJs = require('solid-js');
|
|
6
|
+
var web = require('solid-js/web');
|
|
19
7
|
|
|
20
8
|
// src/index.ts
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
access: () => access,
|
|
24
|
-
accessArray: () => accessArray,
|
|
25
|
-
accessWith: () => accessWith,
|
|
26
|
-
arrayEquals: () => arrayEquals,
|
|
27
|
-
asAccessor: () => asAccessor,
|
|
28
|
-
asArray: () => asArray,
|
|
29
|
-
chain: () => chain,
|
|
30
|
-
clamp: () => clamp,
|
|
31
|
-
compare: () => compare,
|
|
32
|
-
createCallbackStack: () => createCallbackStack,
|
|
33
|
-
createMicrotask: () => createMicrotask,
|
|
34
|
-
createProxy: () => createProxy,
|
|
35
|
-
createStaticStore: () => createStaticStore,
|
|
36
|
-
createTrigger: () => createTrigger,
|
|
37
|
-
createTriggerCache: () => createTriggerCache,
|
|
38
|
-
createWeakTriggerCache: () => createWeakTriggerCache,
|
|
39
|
-
entries: () => entries,
|
|
40
|
-
forEachEntry: () => forEachEntry,
|
|
41
|
-
handleDiffArray: () => handleDiffArray,
|
|
42
|
-
isClient: () => isClient,
|
|
43
|
-
isDev: () => isDev,
|
|
44
|
-
isObject: () => isObject,
|
|
45
|
-
isProd: () => isProd,
|
|
46
|
-
isServer: () => isServer,
|
|
47
|
-
keys: () => keys,
|
|
48
|
-
noop: () => noop,
|
|
49
|
-
ofClass: () => ofClass,
|
|
50
|
-
onRootCleanup: () => onRootCleanup,
|
|
51
|
-
warn: () => warn,
|
|
52
|
-
withAccess: () => withAccess
|
|
53
|
-
});
|
|
54
|
-
module.exports = __toCommonJS(src_exports);
|
|
55
|
-
var import_solid_js = require("solid-js");
|
|
56
|
-
var import_web = require("solid-js/web");
|
|
57
9
|
var noop = () => void 0;
|
|
58
|
-
var isServer =
|
|
10
|
+
var isServer = web.isServer;
|
|
59
11
|
var isClient = !isServer;
|
|
60
|
-
var isDev =
|
|
12
|
+
var isDev = solidJs.DEV && isClient;
|
|
61
13
|
var isProd = !isDev;
|
|
62
|
-
var warn = (...a) => isDev && console.warn(...a);
|
|
63
14
|
var ofClass = (v, c) => v instanceof c || v && v.constructor === c;
|
|
64
15
|
function isObject(value) {
|
|
65
16
|
return value !== null && (typeof value === "object" || typeof value === "function");
|
|
@@ -86,14 +37,9 @@ var asAccessor = (v) => typeof v === "function" ? v : () => v;
|
|
|
86
37
|
function accessWith(valueOrFn, ...args) {
|
|
87
38
|
return typeof valueOrFn === "function" ? valueOrFn(...args) : valueOrFn;
|
|
88
39
|
}
|
|
89
|
-
function forEachEntry(object, iterator) {
|
|
90
|
-
Object.entries(object).forEach(
|
|
91
|
-
([key, item], index, pairs) => iterator(key, item, index, pairs, object)
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
40
|
var entries = Object.entries;
|
|
95
41
|
var keys = Object.keys;
|
|
96
|
-
var onRootCleanup = (fn) =>
|
|
42
|
+
var onRootCleanup = (fn) => solidJs.getOwner() ? solidJs.onCleanup(fn) : fn;
|
|
97
43
|
var createCallbackStack = () => {
|
|
98
44
|
let stack = [];
|
|
99
45
|
const clear = () => stack = [];
|
|
@@ -127,40 +73,6 @@ function createProxy(traps) {
|
|
|
127
73
|
}
|
|
128
74
|
);
|
|
129
75
|
}
|
|
130
|
-
var createTrigger = isDev ? () => (0, import_solid_js.createSignal)(void 0, { equals: false, name: "trigger" }) : () => (0, import_solid_js.createSignal)(void 0, { equals: false });
|
|
131
|
-
function dirtyTriggerCache(key) {
|
|
132
|
-
const trigger = this.get(key);
|
|
133
|
-
if (trigger)
|
|
134
|
-
trigger[1]();
|
|
135
|
-
}
|
|
136
|
-
function dirtyAllTriggerCache() {
|
|
137
|
-
this.forEach((s) => s[1]());
|
|
138
|
-
}
|
|
139
|
-
function trackTriggerCache(key) {
|
|
140
|
-
if (!(0, import_solid_js.getListener)())
|
|
141
|
-
return;
|
|
142
|
-
let trigger = this.get(key);
|
|
143
|
-
if (!trigger) {
|
|
144
|
-
trigger = createTrigger();
|
|
145
|
-
this.set(key, trigger);
|
|
146
|
-
}
|
|
147
|
-
trigger[0]();
|
|
148
|
-
}
|
|
149
|
-
function createTriggerCache() {
|
|
150
|
-
const cache = /* @__PURE__ */ new Map();
|
|
151
|
-
return {
|
|
152
|
-
dirty: dirtyTriggerCache.bind(cache),
|
|
153
|
-
dirtyAll: dirtyAllTriggerCache.bind(cache),
|
|
154
|
-
track: trackTriggerCache.bind(cache)
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
function createWeakTriggerCache() {
|
|
158
|
-
const cache = /* @__PURE__ */ new WeakMap();
|
|
159
|
-
return {
|
|
160
|
-
dirty: dirtyTriggerCache.bind(cache),
|
|
161
|
-
track: trackTriggerCache.bind(cache)
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
76
|
function createStaticStore(init) {
|
|
165
77
|
const copy = { ...init };
|
|
166
78
|
const store = {};
|
|
@@ -169,7 +81,7 @@ function createStaticStore(init) {
|
|
|
169
81
|
const saved = cache.get(key);
|
|
170
82
|
if (saved)
|
|
171
83
|
return saved[0]();
|
|
172
|
-
const signal =
|
|
84
|
+
const signal = solidJs.createSignal(copy[key], {
|
|
173
85
|
name: typeof key === "string" ? key : void 0
|
|
174
86
|
});
|
|
175
87
|
cache.set(key, signal);
|
|
@@ -191,8 +103,8 @@ function createStaticStore(init) {
|
|
|
191
103
|
}
|
|
192
104
|
const setter = (a, b) => {
|
|
193
105
|
if (isObject(a))
|
|
194
|
-
|
|
195
|
-
|
|
106
|
+
solidJs.untrack(() => {
|
|
107
|
+
solidJs.batch(() => {
|
|
196
108
|
for (const [key, value] of entries(accessWith(a, store)))
|
|
197
109
|
setValue(key, () => value);
|
|
198
110
|
});
|
|
@@ -234,36 +146,31 @@ function handleDiffArray(current, prev, handleAdded, handleRemoved) {
|
|
|
234
146
|
handleAdded(currEl);
|
|
235
147
|
}
|
|
236
148
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
ofClass,
|
|
266
|
-
onRootCleanup,
|
|
267
|
-
warn,
|
|
268
|
-
withAccess
|
|
269
|
-
});
|
|
149
|
+
var forEachEntry = (obj, fn) => Object.entries(obj).forEach(([key, value]) => fn(key, value));
|
|
150
|
+
|
|
151
|
+
exports.access = access;
|
|
152
|
+
exports.accessArray = accessArray;
|
|
153
|
+
exports.accessWith = accessWith;
|
|
154
|
+
exports.arrayEquals = arrayEquals;
|
|
155
|
+
exports.asAccessor = asAccessor;
|
|
156
|
+
exports.asArray = asArray;
|
|
157
|
+
exports.chain = chain;
|
|
158
|
+
exports.clamp = clamp;
|
|
159
|
+
exports.compare = compare;
|
|
160
|
+
exports.createCallbackStack = createCallbackStack;
|
|
161
|
+
exports.createMicrotask = createMicrotask;
|
|
162
|
+
exports.createProxy = createProxy;
|
|
163
|
+
exports.createStaticStore = createStaticStore;
|
|
164
|
+
exports.entries = entries;
|
|
165
|
+
exports.forEachEntry = forEachEntry;
|
|
166
|
+
exports.handleDiffArray = handleDiffArray;
|
|
167
|
+
exports.isClient = isClient;
|
|
168
|
+
exports.isDev = isDev;
|
|
169
|
+
exports.isObject = isObject;
|
|
170
|
+
exports.isProd = isProd;
|
|
171
|
+
exports.isServer = isServer;
|
|
172
|
+
exports.keys = keys;
|
|
173
|
+
exports.noop = noop;
|
|
174
|
+
exports.ofClass = ofClass;
|
|
175
|
+
exports.onRootCleanup = onRootCleanup;
|
|
176
|
+
exports.withAccess = withAccess;
|
package/dist/index.d.ts
CHANGED
|
@@ -48,14 +48,6 @@ declare type DeepPartialAny<T> = {
|
|
|
48
48
|
declare type NonIterable<T> = T & {
|
|
49
49
|
[Symbol.iterator]: never;
|
|
50
50
|
};
|
|
51
|
-
/** An opposite of `Partial`. Makes all the keys required. */
|
|
52
|
-
declare type Definite<T> = {
|
|
53
|
-
[K in keyof T]-?: T[K];
|
|
54
|
-
};
|
|
55
|
-
/** An opposite of `Readonly`. Makes all the params mutable. */
|
|
56
|
-
declare type Mutable<T> = {
|
|
57
|
-
-readonly [K in keyof T]: T[K];
|
|
58
|
-
};
|
|
59
51
|
/** Unwraps the type definition of an object, making it more readable */
|
|
60
52
|
declare type Simplify<T> = T extends object ? {
|
|
61
53
|
[K in keyof T]: T[K];
|
|
@@ -94,8 +86,6 @@ declare const isClient = true;
|
|
|
94
86
|
declare const isDev = true;
|
|
95
87
|
/** production environment */
|
|
96
88
|
declare const isProd = false;
|
|
97
|
-
/** `console.warn` only during development */
|
|
98
|
-
declare const warn: typeof console.warn;
|
|
99
89
|
/**
|
|
100
90
|
* Check if the value is an instance of ___
|
|
101
91
|
*/
|
|
@@ -140,10 +130,6 @@ declare const withAccess: <T, A extends MaybeAccessor<T>, V = MaybeAccessorValue
|
|
|
140
130
|
declare const asAccessor: <A extends unknown>(v: A) => Accessor<MaybeAccessorValue<A>>;
|
|
141
131
|
/** If value is a function – call it with a given arguments – otherwise get the value as is */
|
|
142
132
|
declare function accessWith<T>(valueOrFn: T, ...args: T extends AnyFunction ? Parameters<T> : never): T extends AnyFunction ? ReturnType<T> : T;
|
|
143
|
-
/**
|
|
144
|
-
* Iterate through object entries.
|
|
145
|
-
*/
|
|
146
|
-
declare function forEachEntry<O extends AnyObject>(object: O, iterator: (key: keyof O, item: Values<O>, index: number, pairs: [keyof O, Values<O>][], object: O) => void): void;
|
|
147
133
|
/**
|
|
148
134
|
* Get entries of an object
|
|
149
135
|
*/
|
|
@@ -176,61 +162,6 @@ declare function createProxy<T extends Record<string | symbol, any>>(traps: {
|
|
|
176
162
|
get: <K extends keyof T>(key: K) => T[K];
|
|
177
163
|
set?: undefined;
|
|
178
164
|
}): Readonly<T>;
|
|
179
|
-
declare type Trigger = [track: VoidFunction, dirty: VoidFunction];
|
|
180
|
-
/**
|
|
181
|
-
* Set listeners in reactive computations and then trigger them when you want.
|
|
182
|
-
* @returns `[track function, dirty function]`
|
|
183
|
-
* @example
|
|
184
|
-
* const [track, dirty] = createTrigger()
|
|
185
|
-
* createEffect(() => {
|
|
186
|
-
* track()
|
|
187
|
-
* ...
|
|
188
|
-
* })
|
|
189
|
-
* // later
|
|
190
|
-
* dirty()
|
|
191
|
-
*/
|
|
192
|
-
declare const createTrigger: () => Trigger;
|
|
193
|
-
declare type TriggerCache<T> = {
|
|
194
|
-
track: (v: T) => void;
|
|
195
|
-
dirty: (v: T) => void;
|
|
196
|
-
dirtyAll: VoidFunction;
|
|
197
|
-
};
|
|
198
|
-
/**
|
|
199
|
-
* Set listeners in reactive computations and then trigger them when you want. Cache trackers by a `key`.
|
|
200
|
-
* @returns `{ track, dirty, dirtyAll }` functions
|
|
201
|
-
* `track` and `dirty` are called with a `key` so that each tracker will trigger an update only when his individual `key` would get marked as dirty.
|
|
202
|
-
* @example
|
|
203
|
-
* const { track, dirty } = createTriggerCache()
|
|
204
|
-
* createEffect(() => {
|
|
205
|
-
* track(1)
|
|
206
|
-
* ...
|
|
207
|
-
* })
|
|
208
|
-
* // later
|
|
209
|
-
* dirty(1)
|
|
210
|
-
* // this won't cause an update:
|
|
211
|
-
* dirty(2)
|
|
212
|
-
*/
|
|
213
|
-
declare function createTriggerCache<T>(): TriggerCache<T>;
|
|
214
|
-
declare type WeakTriggerCache<T extends object> = {
|
|
215
|
-
track: (v: T) => void;
|
|
216
|
-
dirty: (v: T) => void;
|
|
217
|
-
};
|
|
218
|
-
/**
|
|
219
|
-
* Set listeners in reactive computations and then trigger them when you want. Cache trackers by a `key`.
|
|
220
|
-
* @returns `{ track, dirty }` functions
|
|
221
|
-
* `track` and `dirty` are called with a `key` so that each tracker will trigger an update only when his individual `key` would get marked as dirty.
|
|
222
|
-
* @example
|
|
223
|
-
* const { track, dirty } = createWeakTriggerCache()
|
|
224
|
-
* createEffect(() => {
|
|
225
|
-
* track(1)
|
|
226
|
-
* ...
|
|
227
|
-
* })
|
|
228
|
-
* // later
|
|
229
|
-
* dirty(1)
|
|
230
|
-
* // this won't cause an update:
|
|
231
|
-
* dirty(2)
|
|
232
|
-
*/
|
|
233
|
-
declare function createWeakTriggerCache<T extends object>(): WeakTriggerCache<T>;
|
|
234
165
|
declare type StaticStoreSetter<T extends Readonly<AnyStatic>> = {
|
|
235
166
|
(setter: (prev: T) => Partial<T>): T;
|
|
236
167
|
(state: Partial<T>): T;
|
|
@@ -254,5 +185,6 @@ declare function createStaticStore<T extends Readonly<AnyStatic>>(init: T): [acc
|
|
|
254
185
|
* @param handleRemoved called once for every removed from array
|
|
255
186
|
*/
|
|
256
187
|
declare function handleDiffArray<T>(current: readonly T[], prev: readonly T[], handleAdded: (item: T) => void, handleRemoved: (item: T) => void): void;
|
|
188
|
+
declare const forEachEntry: <T>(obj: Record<string, T>, fn: (key: string, value: T) => void) => void;
|
|
257
189
|
|
|
258
|
-
export { AccessReturnTypes, AnyClass, AnyFunction, AnyObject, AnyStatic, DeepPartialAny,
|
|
190
|
+
export { AccessReturnTypes, AnyClass, AnyFunction, AnyObject, AnyStatic, DeepPartialAny, Directive, ExtractIfPossible, Falsy, FalsyValue, ItemsOf, ItemsOfMany, Many, MaybeAccessor, MaybeAccessorValue, Modify, ModifyDeep, NonIterable, Noop, OnAccessEffectFunction, Position, PrimitiveValue, RequiredKeys, SetterValue, Simplify, StaticStoreSetter, Tail, Truthy, UnboxLazy, UnionToIntersection, Values, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createMicrotask, createProxy, createStaticStore, entries, forEachEntry, handleDiffArray, isClient, isDev, isObject, isProd, isServer, keys, noop, ofClass, onRootCleanup, withAccess };
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
|
+
import { DEV, getOwner, onCleanup, createSignal, untrack, batch } from 'solid-js';
|
|
2
|
+
import { isServer as isServer$1 } from 'solid-js/web';
|
|
3
|
+
|
|
1
4
|
// src/index.ts
|
|
2
|
-
import {
|
|
3
|
-
getOwner,
|
|
4
|
-
onCleanup,
|
|
5
|
-
createSignal,
|
|
6
|
-
DEV,
|
|
7
|
-
untrack,
|
|
8
|
-
batch,
|
|
9
|
-
getListener
|
|
10
|
-
} from "solid-js";
|
|
11
|
-
import { isServer as _isServer } from "solid-js/web";
|
|
12
5
|
var noop = () => void 0;
|
|
13
|
-
var isServer =
|
|
6
|
+
var isServer = isServer$1;
|
|
14
7
|
var isClient = !isServer;
|
|
15
8
|
var isDev = DEV && isClient;
|
|
16
9
|
var isProd = !isDev;
|
|
17
|
-
var warn = (...a) => isDev && console.warn(...a);
|
|
18
10
|
var ofClass = (v, c) => v instanceof c || v && v.constructor === c;
|
|
19
11
|
function isObject(value) {
|
|
20
12
|
return value !== null && (typeof value === "object" || typeof value === "function");
|
|
@@ -41,11 +33,6 @@ var asAccessor = (v) => typeof v === "function" ? v : () => v;
|
|
|
41
33
|
function accessWith(valueOrFn, ...args) {
|
|
42
34
|
return typeof valueOrFn === "function" ? valueOrFn(...args) : valueOrFn;
|
|
43
35
|
}
|
|
44
|
-
function forEachEntry(object, iterator) {
|
|
45
|
-
Object.entries(object).forEach(
|
|
46
|
-
([key, item], index, pairs) => iterator(key, item, index, pairs, object)
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
36
|
var entries = Object.entries;
|
|
50
37
|
var keys = Object.keys;
|
|
51
38
|
var onRootCleanup = (fn) => getOwner() ? onCleanup(fn) : fn;
|
|
@@ -82,40 +69,6 @@ function createProxy(traps) {
|
|
|
82
69
|
}
|
|
83
70
|
);
|
|
84
71
|
}
|
|
85
|
-
var createTrigger = isDev ? () => createSignal(void 0, { equals: false, name: "trigger" }) : () => createSignal(void 0, { equals: false });
|
|
86
|
-
function dirtyTriggerCache(key) {
|
|
87
|
-
const trigger = this.get(key);
|
|
88
|
-
if (trigger)
|
|
89
|
-
trigger[1]();
|
|
90
|
-
}
|
|
91
|
-
function dirtyAllTriggerCache() {
|
|
92
|
-
this.forEach((s) => s[1]());
|
|
93
|
-
}
|
|
94
|
-
function trackTriggerCache(key) {
|
|
95
|
-
if (!getListener())
|
|
96
|
-
return;
|
|
97
|
-
let trigger = this.get(key);
|
|
98
|
-
if (!trigger) {
|
|
99
|
-
trigger = createTrigger();
|
|
100
|
-
this.set(key, trigger);
|
|
101
|
-
}
|
|
102
|
-
trigger[0]();
|
|
103
|
-
}
|
|
104
|
-
function createTriggerCache() {
|
|
105
|
-
const cache = /* @__PURE__ */ new Map();
|
|
106
|
-
return {
|
|
107
|
-
dirty: dirtyTriggerCache.bind(cache),
|
|
108
|
-
dirtyAll: dirtyAllTriggerCache.bind(cache),
|
|
109
|
-
track: trackTriggerCache.bind(cache)
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
function createWeakTriggerCache() {
|
|
113
|
-
const cache = /* @__PURE__ */ new WeakMap();
|
|
114
|
-
return {
|
|
115
|
-
dirty: dirtyTriggerCache.bind(cache),
|
|
116
|
-
track: trackTriggerCache.bind(cache)
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
72
|
function createStaticStore(init) {
|
|
120
73
|
const copy = { ...init };
|
|
121
74
|
const store = {};
|
|
@@ -189,35 +142,6 @@ function handleDiffArray(current, prev, handleAdded, handleRemoved) {
|
|
|
189
142
|
handleAdded(currEl);
|
|
190
143
|
}
|
|
191
144
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
accessWith,
|
|
196
|
-
arrayEquals,
|
|
197
|
-
asAccessor,
|
|
198
|
-
asArray,
|
|
199
|
-
chain,
|
|
200
|
-
clamp,
|
|
201
|
-
compare,
|
|
202
|
-
createCallbackStack,
|
|
203
|
-
createMicrotask,
|
|
204
|
-
createProxy,
|
|
205
|
-
createStaticStore,
|
|
206
|
-
createTrigger,
|
|
207
|
-
createTriggerCache,
|
|
208
|
-
createWeakTriggerCache,
|
|
209
|
-
entries,
|
|
210
|
-
forEachEntry,
|
|
211
|
-
handleDiffArray,
|
|
212
|
-
isClient,
|
|
213
|
-
isDev,
|
|
214
|
-
isObject,
|
|
215
|
-
isProd,
|
|
216
|
-
isServer,
|
|
217
|
-
keys,
|
|
218
|
-
noop,
|
|
219
|
-
ofClass,
|
|
220
|
-
onRootCleanup,
|
|
221
|
-
warn,
|
|
222
|
-
withAccess
|
|
223
|
-
};
|
|
145
|
+
var forEachEntry = (obj, fn) => Object.entries(obj).forEach(([key, value]) => fn(key, value));
|
|
146
|
+
|
|
147
|
+
export { access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createMicrotask, createProxy, createStaticStore, entries, forEachEntry, handleDiffArray, isClient, isDev, isObject, isProd, isServer, keys, noop, ofClass, onRootCleanup, withAccess };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solid-primitives/utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
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
|
"license": "MIT",
|
|
@@ -14,13 +14,21 @@
|
|
|
14
14
|
},
|
|
15
15
|
"private": false,
|
|
16
16
|
"sideEffects": false,
|
|
17
|
-
"type": "module",
|
|
18
|
-
"main": "dist/index.cjs",
|
|
19
|
-
"module": "dist/index.js",
|
|
20
|
-
"types": "dist/index.d.ts",
|
|
21
17
|
"files": [
|
|
22
18
|
"dist"
|
|
23
19
|
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"main": "./dist/index.cjs",
|
|
22
|
+
"module": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
"browser": {
|
|
26
|
+
"import": "./dist/index.js",
|
|
27
|
+
"require": "./dist/index.cjs"
|
|
28
|
+
},
|
|
29
|
+
"import": "./dist/index.js",
|
|
30
|
+
"require": "./dist/index.cjs"
|
|
31
|
+
},
|
|
24
32
|
"keywords": [
|
|
25
33
|
"utilities",
|
|
26
34
|
"reactivity",
|
|
@@ -30,19 +38,18 @@
|
|
|
30
38
|
"devDependencies": {
|
|
31
39
|
"jsdom": "^20.0.0",
|
|
32
40
|
"prettier": "^2.7.1",
|
|
33
|
-
"solid-js": "^1.
|
|
34
|
-
"solid-register": "^0.2.5",
|
|
41
|
+
"solid-js": "^1.6.0",
|
|
35
42
|
"tslib": "^2.4.0",
|
|
36
|
-
"tsup": "^6.2.
|
|
37
|
-
"
|
|
38
|
-
"watchlist": "^0.3.1"
|
|
43
|
+
"tsup": "^6.2.3",
|
|
44
|
+
"vitest": "^0.24.1"
|
|
39
45
|
},
|
|
46
|
+
"browser": {},
|
|
40
47
|
"peerDependencies": {
|
|
41
|
-
"solid-js": "^1.
|
|
48
|
+
"solid-js": "^1.6.0"
|
|
42
49
|
},
|
|
43
50
|
"scripts": {
|
|
44
|
-
"build": "
|
|
45
|
-
"test": "
|
|
46
|
-
"test:
|
|
51
|
+
"build": "jiti ../../scripts/build.ts",
|
|
52
|
+
"test": "vitest -c ../../configs/vitest.config.ts",
|
|
53
|
+
"test:ssr": "pnpm run test --mode ssr"
|
|
47
54
|
}
|
|
48
55
|
}
|