@solid-primitives/utils 3.1.0 → 4.0.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/index.cjs +23 -82
- package/dist/index.d.ts +32 -87
- package/dist/index.js +3 -38
- package/package.json +7 -15
package/dist/index.cjs
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var solidJs = require('solid-js');
|
|
6
4
|
var web = require('solid-js/web');
|
|
7
5
|
|
|
8
6
|
// src/index.ts
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
exports.noop = () => void 0;
|
|
8
|
+
exports.isServer = web.isServer;
|
|
9
|
+
exports.isClient = !exports.isServer;
|
|
10
|
+
exports.isDev = solidJs.DEV && exports.isClient;
|
|
11
|
+
exports.isProd = !exports.isDev;
|
|
12
|
+
exports.ofClass = (v, c) => v instanceof c || v && v.constructor === c;
|
|
15
13
|
function isObject(value) {
|
|
16
14
|
return value !== null && (typeof value === "object" || typeof value === "function");
|
|
17
15
|
}
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
exports.compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
17
|
+
exports.arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);
|
|
20
18
|
function chain(callbacks) {
|
|
21
19
|
return (...args) => {
|
|
22
20
|
for (const callback of callbacks) {
|
|
@@ -25,22 +23,22 @@ function chain(callbacks) {
|
|
|
25
23
|
}
|
|
26
24
|
};
|
|
27
25
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const _value = access(value);
|
|
26
|
+
exports.clamp = (n, min, max) => Math.min(Math.max(n, min), max);
|
|
27
|
+
exports.access = (v) => typeof v === "function" && !v.length ? v() : v;
|
|
28
|
+
exports.asArray = (value) => Array.isArray(value) ? value : [value];
|
|
29
|
+
exports.accessArray = (list) => list.map((v) => exports.access(v));
|
|
30
|
+
exports.withAccess = (value, fn) => {
|
|
31
|
+
const _value = exports.access(value);
|
|
34
32
|
typeof _value !== "undefined" && _value !== null && fn(_value);
|
|
35
33
|
};
|
|
36
|
-
|
|
34
|
+
exports.asAccessor = (v) => typeof v === "function" ? v : () => v;
|
|
37
35
|
function accessWith(valueOrFn, ...args) {
|
|
38
36
|
return typeof valueOrFn === "function" ? valueOrFn(...args) : valueOrFn;
|
|
39
37
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
exports.entries = Object.entries;
|
|
39
|
+
exports.keys = Object.keys;
|
|
40
|
+
exports.onRootCleanup = (fn) => solidJs.getOwner() ? solidJs.onCleanup(fn) : fn;
|
|
41
|
+
exports.createCallbackStack = () => {
|
|
44
42
|
let stack = [];
|
|
45
43
|
const clear = () => stack = [];
|
|
46
44
|
return {
|
|
@@ -66,47 +64,12 @@ function createProxy(traps) {
|
|
|
66
64
|
{
|
|
67
65
|
get: (_, k) => traps.get(k),
|
|
68
66
|
set: (_, k, v) => {
|
|
69
|
-
|
|
70
|
-
(_a = traps.set) == null ? void 0 : _a.call(traps, k, v);
|
|
67
|
+
traps.set?.(k, v);
|
|
71
68
|
return false;
|
|
72
69
|
}
|
|
73
70
|
}
|
|
74
71
|
);
|
|
75
72
|
}
|
|
76
|
-
var createTrigger = isDev ? () => solidJs.createSignal(void 0, { equals: false, name: "trigger" }) : () => solidJs.createSignal(void 0, { equals: false });
|
|
77
|
-
function dirtyTriggerCache(key) {
|
|
78
|
-
const trigger = this.get(key);
|
|
79
|
-
if (trigger)
|
|
80
|
-
trigger[1]();
|
|
81
|
-
}
|
|
82
|
-
function dirtyAllTriggerCache() {
|
|
83
|
-
this.forEach((s) => s[1]());
|
|
84
|
-
}
|
|
85
|
-
function trackTriggerCache(key) {
|
|
86
|
-
if (!solidJs.getListener())
|
|
87
|
-
return;
|
|
88
|
-
let trigger = this.get(key);
|
|
89
|
-
if (!trigger) {
|
|
90
|
-
trigger = createTrigger();
|
|
91
|
-
this.set(key, trigger);
|
|
92
|
-
}
|
|
93
|
-
trigger[0]();
|
|
94
|
-
}
|
|
95
|
-
function createTriggerCache() {
|
|
96
|
-
const cache = /* @__PURE__ */ new Map();
|
|
97
|
-
return {
|
|
98
|
-
dirty: dirtyTriggerCache.bind(cache),
|
|
99
|
-
dirtyAll: dirtyAllTriggerCache.bind(cache),
|
|
100
|
-
track: trackTriggerCache.bind(cache)
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
function createWeakTriggerCache() {
|
|
104
|
-
const cache = /* @__PURE__ */ new WeakMap();
|
|
105
|
-
return {
|
|
106
|
-
dirty: dirtyTriggerCache.bind(cache),
|
|
107
|
-
track: trackTriggerCache.bind(cache)
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
73
|
function createStaticStore(init) {
|
|
111
74
|
const copy = { ...init };
|
|
112
75
|
const store = {};
|
|
@@ -129,7 +92,7 @@ function createStaticStore(init) {
|
|
|
129
92
|
if (key in copy)
|
|
130
93
|
copy[key] = accessWith(value, [copy[key]]);
|
|
131
94
|
};
|
|
132
|
-
for (const key of keys(init)) {
|
|
95
|
+
for (const key of exports.keys(init)) {
|
|
133
96
|
store[key] = void 0;
|
|
134
97
|
Object.defineProperty(store, key, {
|
|
135
98
|
get: getValue.bind(void 0, key)
|
|
@@ -139,7 +102,7 @@ function createStaticStore(init) {
|
|
|
139
102
|
if (isObject(a))
|
|
140
103
|
solidJs.untrack(() => {
|
|
141
104
|
solidJs.batch(() => {
|
|
142
|
-
for (const [key, value] of entries(accessWith(a, store)))
|
|
105
|
+
for (const [key, value] of exports.entries(accessWith(a, store)))
|
|
143
106
|
setValue(key, () => value);
|
|
144
107
|
});
|
|
145
108
|
});
|
|
@@ -180,34 +143,12 @@ function handleDiffArray(current, prev, handleAdded, handleRemoved) {
|
|
|
180
143
|
handleAdded(currEl);
|
|
181
144
|
}
|
|
182
145
|
}
|
|
183
|
-
|
|
146
|
+
exports.forEachEntry = (obj, fn) => Object.entries(obj).forEach(([key, value]) => fn(key, value));
|
|
184
147
|
|
|
185
|
-
exports.access = access;
|
|
186
|
-
exports.accessArray = accessArray;
|
|
187
148
|
exports.accessWith = accessWith;
|
|
188
|
-
exports.arrayEquals = arrayEquals;
|
|
189
|
-
exports.asAccessor = asAccessor;
|
|
190
|
-
exports.asArray = asArray;
|
|
191
149
|
exports.chain = chain;
|
|
192
|
-
exports.clamp = clamp;
|
|
193
|
-
exports.compare = compare;
|
|
194
|
-
exports.createCallbackStack = createCallbackStack;
|
|
195
150
|
exports.createMicrotask = createMicrotask;
|
|
196
151
|
exports.createProxy = createProxy;
|
|
197
152
|
exports.createStaticStore = createStaticStore;
|
|
198
|
-
exports.createTrigger = createTrigger;
|
|
199
|
-
exports.createTriggerCache = createTriggerCache;
|
|
200
|
-
exports.createWeakTriggerCache = createWeakTriggerCache;
|
|
201
|
-
exports.entries = entries;
|
|
202
|
-
exports.forEachEntry = forEachEntry;
|
|
203
153
|
exports.handleDiffArray = handleDiffArray;
|
|
204
|
-
exports.isClient = isClient;
|
|
205
|
-
exports.isDev = isDev;
|
|
206
154
|
exports.isObject = isObject;
|
|
207
|
-
exports.isProd = isProd;
|
|
208
|
-
exports.isServer = isServer;
|
|
209
|
-
exports.keys = keys;
|
|
210
|
-
exports.noop = noop;
|
|
211
|
-
exports.ofClass = ofClass;
|
|
212
|
-
exports.onRootCleanup = onRootCleanup;
|
|
213
|
-
exports.withAccess = withAccess;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,20 +3,20 @@ import { Accessor, Setter, onCleanup } from 'solid-js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Can be single or in an array
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
type Many<T> = T | T[];
|
|
7
|
+
type Values<O extends Object> = O[keyof O];
|
|
8
|
+
type Noop = (...a: any[]) => void;
|
|
9
|
+
type Directive<P = true> = (el: Element, props: Accessor<P>) => void;
|
|
10
10
|
/**
|
|
11
11
|
* Infers the type of the array elements
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
type ItemsOf<T> = T extends (infer E)[] ? E : never;
|
|
14
|
+
type ItemsOfMany<T> = T extends any[] ? ItemsOf<T> : T;
|
|
15
|
+
type SetterValue<T> = Parameters<Setter<T>>[0];
|
|
16
16
|
/**
|
|
17
17
|
* T or a reactive/non-reactive function returning T
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
type MaybeAccessor<T> = T | Accessor<T>;
|
|
20
20
|
/**
|
|
21
21
|
* Accessed value of a MaybeAccessor
|
|
22
22
|
* @example
|
|
@@ -29,51 +29,51 @@ declare type MaybeAccessor<T> = T | Accessor<T>;
|
|
|
29
29
|
* // => string | void
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
type MaybeAccessorValue<T extends MaybeAccessor<any>> = T extends () => any ? ReturnType<T> : T;
|
|
33
|
+
type OnAccessEffectFunction<S, Prev, Next extends Prev = Prev> = (input: AccessReturnTypes<S>, prevInput: AccessReturnTypes<S>, v: Prev) => Next;
|
|
34
|
+
type AccessReturnTypes<S> = S extends MaybeAccessor<any>[] ? {
|
|
35
35
|
[I in keyof S]: AccessReturnTypes<S[I]>;
|
|
36
36
|
} : MaybeAccessorValue<S>;
|
|
37
37
|
/** Allows to make shallow overwrites to an interface */
|
|
38
|
-
|
|
38
|
+
type Modify<T, R> = Omit<T, keyof R> & R;
|
|
39
39
|
/** Allows to make nested overwrites to an interface */
|
|
40
|
-
|
|
40
|
+
type ModifyDeep<A extends AnyObject, B extends DeepPartialAny<A>> = {
|
|
41
41
|
[K in keyof A]: B[K] extends never ? A[K] : B[K] extends AnyObject ? ModifyDeep<A[K], B[K]> : B[K];
|
|
42
42
|
} & (A extends AnyObject ? Omit<B, keyof A> : A);
|
|
43
43
|
/** Makes each property optional and turns each leaf property into any, allowing for type overrides by narrowing any. */
|
|
44
|
-
|
|
44
|
+
type DeepPartialAny<T> = {
|
|
45
45
|
[P in keyof T]?: T[P] extends AnyObject ? DeepPartialAny<T[P]> : any;
|
|
46
46
|
};
|
|
47
47
|
/** Removes the `[...list]` functionality */
|
|
48
|
-
|
|
48
|
+
type NonIterable<T> = T & {
|
|
49
49
|
[Symbol.iterator]: never;
|
|
50
50
|
};
|
|
51
51
|
/** Unwraps the type definition of an object, making it more readable */
|
|
52
|
-
|
|
52
|
+
type Simplify<T> = T extends object ? {
|
|
53
53
|
[K in keyof T]: T[K];
|
|
54
54
|
} : T;
|
|
55
55
|
/** Unboxes type definition, making it more readable */
|
|
56
|
-
|
|
56
|
+
type UnboxLazy<T> = T extends () => infer U ? U : T;
|
|
57
57
|
/** Get the required keys of an object */
|
|
58
|
-
|
|
58
|
+
type RequiredKeys<T> = keyof {
|
|
59
59
|
[K in keyof T as T extends {
|
|
60
60
|
[_ in K]: unknown;
|
|
61
61
|
} ? K : never]: 0;
|
|
62
62
|
};
|
|
63
63
|
/** Remove the first item of a tuple [1, 2, 3, 4] => [2, 3, 4] */
|
|
64
|
-
|
|
64
|
+
type Tail<T extends any[]> = ((...t: T) => void) extends (x: any, ...u: infer U) => void ? U : never;
|
|
65
65
|
/** `A | B => A & B` */
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
66
|
+
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
67
|
+
type ExtractIfPossible<T, U> = Extract<T, U> extends never ? U : Extract<T, U>;
|
|
68
|
+
type AnyObject = Record<PropertyKey, any>;
|
|
69
|
+
type AnyStatic = [] | any[] | AnyObject;
|
|
70
|
+
type AnyFunction = (...args: any[]) => any;
|
|
71
|
+
type AnyClass = abstract new (...args: any) => any;
|
|
72
|
+
type PrimitiveValue = PropertyKey | boolean | bigint | null | undefined;
|
|
73
|
+
type FalsyValue = false | 0 | "" | null | undefined;
|
|
74
|
+
type Truthy<T> = Exclude<T, FalsyValue>;
|
|
75
|
+
type Falsy<T> = Extract<T, FalsyValue>;
|
|
76
|
+
type Position = {
|
|
77
77
|
x: number;
|
|
78
78
|
y: number;
|
|
79
79
|
};
|
|
@@ -162,62 +162,7 @@ declare function createProxy<T extends Record<string | symbol, any>>(traps: {
|
|
|
162
162
|
get: <K extends keyof T>(key: K) => T[K];
|
|
163
163
|
set?: undefined;
|
|
164
164
|
}): Readonly<T>;
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Set listeners in reactive computations and then trigger them when you want.
|
|
168
|
-
* @returns `[track function, dirty function]`
|
|
169
|
-
* @example
|
|
170
|
-
* const [track, dirty] = createTrigger()
|
|
171
|
-
* createEffect(() => {
|
|
172
|
-
* track()
|
|
173
|
-
* ...
|
|
174
|
-
* })
|
|
175
|
-
* // later
|
|
176
|
-
* dirty()
|
|
177
|
-
*/
|
|
178
|
-
declare const createTrigger: () => Trigger;
|
|
179
|
-
declare type TriggerCache<T> = {
|
|
180
|
-
track: (v: T) => void;
|
|
181
|
-
dirty: (v: T) => void;
|
|
182
|
-
dirtyAll: VoidFunction;
|
|
183
|
-
};
|
|
184
|
-
/**
|
|
185
|
-
* Set listeners in reactive computations and then trigger them when you want. Cache trackers by a `key`.
|
|
186
|
-
* @returns `{ track, dirty, dirtyAll }` functions
|
|
187
|
-
* `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.
|
|
188
|
-
* @example
|
|
189
|
-
* const { track, dirty } = createTriggerCache()
|
|
190
|
-
* createEffect(() => {
|
|
191
|
-
* track(1)
|
|
192
|
-
* ...
|
|
193
|
-
* })
|
|
194
|
-
* // later
|
|
195
|
-
* dirty(1)
|
|
196
|
-
* // this won't cause an update:
|
|
197
|
-
* dirty(2)
|
|
198
|
-
*/
|
|
199
|
-
declare function createTriggerCache<T>(): TriggerCache<T>;
|
|
200
|
-
declare type WeakTriggerCache<T extends object> = {
|
|
201
|
-
track: (v: T) => void;
|
|
202
|
-
dirty: (v: T) => void;
|
|
203
|
-
};
|
|
204
|
-
/**
|
|
205
|
-
* Set listeners in reactive computations and then trigger them when you want. Cache trackers by a `key`.
|
|
206
|
-
* @returns `{ track, dirty }` functions
|
|
207
|
-
* `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.
|
|
208
|
-
* @example
|
|
209
|
-
* const { track, dirty } = createWeakTriggerCache()
|
|
210
|
-
* createEffect(() => {
|
|
211
|
-
* track(1)
|
|
212
|
-
* ...
|
|
213
|
-
* })
|
|
214
|
-
* // later
|
|
215
|
-
* dirty(1)
|
|
216
|
-
* // this won't cause an update:
|
|
217
|
-
* dirty(2)
|
|
218
|
-
*/
|
|
219
|
-
declare function createWeakTriggerCache<T extends object>(): WeakTriggerCache<T>;
|
|
220
|
-
declare type StaticStoreSetter<T extends Readonly<AnyStatic>> = {
|
|
165
|
+
type StaticStoreSetter<T extends Readonly<AnyStatic>> = {
|
|
221
166
|
(setter: (prev: T) => Partial<T>): T;
|
|
222
167
|
(state: Partial<T>): T;
|
|
223
168
|
<K extends keyof T>(key: K, state: SetterValue<T[K]>): T;
|
|
@@ -242,4 +187,4 @@ declare function createStaticStore<T extends Readonly<AnyStatic>>(init: T): [acc
|
|
|
242
187
|
declare function handleDiffArray<T>(current: readonly T[], prev: readonly T[], handleAdded: (item: T) => void, handleRemoved: (item: T) => void): void;
|
|
243
188
|
declare const forEachEntry: <T>(obj: Record<string, T>, fn: (key: string, value: T) => void) => void;
|
|
244
189
|
|
|
245
|
-
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,
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import { DEV, getOwner, onCleanup, createSignal,
|
|
1
|
+
import { DEV, getOwner, onCleanup, createSignal, untrack, batch } from 'solid-js';
|
|
2
2
|
import { isServer as isServer$1 } from 'solid-js/web';
|
|
3
3
|
|
|
4
4
|
// src/index.ts
|
|
@@ -62,47 +62,12 @@ function createProxy(traps) {
|
|
|
62
62
|
{
|
|
63
63
|
get: (_, k) => traps.get(k),
|
|
64
64
|
set: (_, k, v) => {
|
|
65
|
-
|
|
66
|
-
(_a = traps.set) == null ? void 0 : _a.call(traps, k, v);
|
|
65
|
+
traps.set?.(k, v);
|
|
67
66
|
return false;
|
|
68
67
|
}
|
|
69
68
|
}
|
|
70
69
|
);
|
|
71
70
|
}
|
|
72
|
-
var createTrigger = isDev ? () => createSignal(void 0, { equals: false, name: "trigger" }) : () => createSignal(void 0, { equals: false });
|
|
73
|
-
function dirtyTriggerCache(key) {
|
|
74
|
-
const trigger = this.get(key);
|
|
75
|
-
if (trigger)
|
|
76
|
-
trigger[1]();
|
|
77
|
-
}
|
|
78
|
-
function dirtyAllTriggerCache() {
|
|
79
|
-
this.forEach((s) => s[1]());
|
|
80
|
-
}
|
|
81
|
-
function trackTriggerCache(key) {
|
|
82
|
-
if (!getListener())
|
|
83
|
-
return;
|
|
84
|
-
let trigger = this.get(key);
|
|
85
|
-
if (!trigger) {
|
|
86
|
-
trigger = createTrigger();
|
|
87
|
-
this.set(key, trigger);
|
|
88
|
-
}
|
|
89
|
-
trigger[0]();
|
|
90
|
-
}
|
|
91
|
-
function createTriggerCache() {
|
|
92
|
-
const cache = /* @__PURE__ */ new Map();
|
|
93
|
-
return {
|
|
94
|
-
dirty: dirtyTriggerCache.bind(cache),
|
|
95
|
-
dirtyAll: dirtyAllTriggerCache.bind(cache),
|
|
96
|
-
track: trackTriggerCache.bind(cache)
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
function createWeakTriggerCache() {
|
|
100
|
-
const cache = /* @__PURE__ */ new WeakMap();
|
|
101
|
-
return {
|
|
102
|
-
dirty: dirtyTriggerCache.bind(cache),
|
|
103
|
-
track: trackTriggerCache.bind(cache)
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
71
|
function createStaticStore(init) {
|
|
107
72
|
const copy = { ...init };
|
|
108
73
|
const store = {};
|
|
@@ -178,4 +143,4 @@ function handleDiffArray(current, prev, handleAdded, handleRemoved) {
|
|
|
178
143
|
}
|
|
179
144
|
var forEachEntry = (obj, fn) => Object.entries(obj).forEach(([key, value]) => fn(key, value));
|
|
180
145
|
|
|
181
|
-
export { access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createMicrotask, createProxy, createStaticStore,
|
|
146
|
+
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.1",
|
|
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",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"main": "./dist/index.cjs",
|
|
22
22
|
"module": "./dist/index.js",
|
|
23
23
|
"types": "./dist/index.d.ts",
|
|
24
|
+
"browser": {},
|
|
24
25
|
"exports": {
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
26
|
+
"import": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"default": "./dist/index.js"
|
|
28
29
|
},
|
|
29
|
-
"import": "./dist/index.js",
|
|
30
30
|
"require": "./dist/index.cjs"
|
|
31
31
|
},
|
|
32
32
|
"keywords": [
|
|
@@ -35,18 +35,10 @@
|
|
|
35
35
|
"solid",
|
|
36
36
|
"primitives"
|
|
37
37
|
],
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"jsdom": "^20.0.0",
|
|
40
|
-
"prettier": "^2.7.1",
|
|
41
|
-
"solid-js": "^1.5.0",
|
|
42
|
-
"tslib": "^2.4.0",
|
|
43
|
-
"tsup": "^6.2.3",
|
|
44
|
-
"vitest": "^0.24.1"
|
|
45
|
-
},
|
|
46
|
-
"browser": {},
|
|
47
38
|
"peerDependencies": {
|
|
48
|
-
"solid-js": "^1.
|
|
39
|
+
"solid-js": "^1.6.0"
|
|
49
40
|
},
|
|
41
|
+
"typesVersions": {},
|
|
50
42
|
"scripts": {
|
|
51
43
|
"build": "jiti ../../scripts/build.ts",
|
|
52
44
|
"test": "vitest -c ../../configs/vitest.config.ts",
|