@solid-primitives/utils 3.0.0 → 3.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/LICENSE +21 -21
- package/README.md +19 -19
- package/dist/index.cjs +8 -13
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -13
- package/package.json +9 -9
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 Solid Primitives Working Group
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Solid Primitives Working Group
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
<p>
|
|
2
|
-
<img width="100%" src="https://assets.solidjs.com/banner?type=Primitives&background=tiles&project=Utils" alt="Solid Primitives Utils">
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
|
-
# @solid-primitives/utils
|
|
6
|
-
|
|
7
|
-
Solid Primitives Utilities is a support and helper package for a number of primitives in our library. Please free to augment or centralize useful utilities and methods in this package for sharing.
|
|
8
|
-
|
|
9
|
-
## Installation
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install @solid-primitives/utils
|
|
13
|
-
# or
|
|
14
|
-
yarn add @solid-primitives/utils
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Changelog
|
|
18
|
-
|
|
19
|
-
See [CHANGELOG.md](./CHANGELOG.md)
|
|
1
|
+
<p>
|
|
2
|
+
<img width="100%" src="https://assets.solidjs.com/banner?type=Primitives&background=tiles&project=Utils" alt="Solid Primitives Utils">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# @solid-primitives/utils
|
|
6
|
+
|
|
7
|
+
Solid Primitives Utilities is a support and helper package for a number of primitives in our library. Please free to augment or centralize useful utilities and methods in this package for sharing.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @solid-primitives/utils
|
|
13
|
+
# or
|
|
14
|
+
yarn add @solid-primitives/utils
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Changelog
|
|
18
|
+
|
|
19
|
+
See [CHANGELOG.md](./CHANGELOG.md)
|
package/dist/index.cjs
CHANGED
|
@@ -87,9 +87,7 @@ function accessWith(valueOrFn, ...args) {
|
|
|
87
87
|
return typeof valueOrFn === "function" ? valueOrFn(...args) : valueOrFn;
|
|
88
88
|
}
|
|
89
89
|
function forEachEntry(object, iterator) {
|
|
90
|
-
Object.entries(object).forEach(
|
|
91
|
-
([key, item], index, pairs) => iterator(key, item, index, pairs, object)
|
|
92
|
-
);
|
|
90
|
+
Object.entries(object).forEach(([key, item], index, pairs) => iterator(key, item, index, pairs, object));
|
|
93
91
|
}
|
|
94
92
|
var entries = Object.entries;
|
|
95
93
|
var keys = Object.keys;
|
|
@@ -115,17 +113,14 @@ function createMicrotask(fn) {
|
|
|
115
113
|
};
|
|
116
114
|
}
|
|
117
115
|
function createProxy(traps) {
|
|
118
|
-
return new Proxy(
|
|
119
|
-
|
|
120
|
-
{
|
|
121
|
-
|
|
122
|
-
set: (
|
|
123
|
-
|
|
124
|
-
(_a = traps.set) == null ? void 0 : _a.call(traps, k, v);
|
|
125
|
-
return false;
|
|
126
|
-
}
|
|
116
|
+
return new Proxy({}, {
|
|
117
|
+
get: (_, k) => traps.get(k),
|
|
118
|
+
set: (_, k, v) => {
|
|
119
|
+
var _a;
|
|
120
|
+
(_a = traps.set) == null ? void 0 : _a.call(traps, k, v);
|
|
121
|
+
return false;
|
|
127
122
|
}
|
|
128
|
-
);
|
|
123
|
+
});
|
|
129
124
|
}
|
|
130
125
|
var createTrigger = isDev ? () => (0, import_solid_js.createSignal)(void 0, { equals: false, name: "trigger" }) : () => (0, import_solid_js.createSignal)(void 0, { equals: false });
|
|
131
126
|
function dirtyTriggerCache(key) {
|
package/dist/index.d.ts
CHANGED
|
@@ -253,6 +253,6 @@ declare function createStaticStore<T extends Readonly<AnyStatic>>(init: T): [acc
|
|
|
253
253
|
* @param handleAdded called once for every added item to array
|
|
254
254
|
* @param handleRemoved called once for every removed from array
|
|
255
255
|
*/
|
|
256
|
-
declare function handleDiffArray<T>(current: T[], prev: T[], handleAdded: (item: T) => void, handleRemoved: (item: T) => void): void;
|
|
256
|
+
declare function handleDiffArray<T>(current: readonly T[], prev: readonly T[], handleAdded: (item: T) => void, handleRemoved: (item: T) => void): void;
|
|
257
257
|
|
|
258
258
|
export { AccessReturnTypes, AnyClass, AnyFunction, AnyObject, AnyStatic, DeepPartialAny, Definite, Directive, ExtractIfPossible, Falsy, FalsyValue, ItemsOf, ItemsOfMany, Many, MaybeAccessor, MaybeAccessorValue, Modify, ModifyDeep, Mutable, NonIterable, Noop, OnAccessEffectFunction, Position, PrimitiveValue, RequiredKeys, SetterValue, Simplify, StaticStoreSetter, Tail, Trigger, TriggerCache, Truthy, UnboxLazy, UnionToIntersection, Values, WeakTriggerCache, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createMicrotask, createProxy, createStaticStore, createTrigger, createTriggerCache, createWeakTriggerCache, entries, forEachEntry, handleDiffArray, isClient, isDev, isObject, isProd, isServer, keys, noop, ofClass, onRootCleanup, warn, withAccess };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
// src/index.ts
|
|
2
4
|
import {
|
|
3
5
|
getOwner,
|
|
@@ -42,9 +44,7 @@ function accessWith(valueOrFn, ...args) {
|
|
|
42
44
|
return typeof valueOrFn === "function" ? valueOrFn(...args) : valueOrFn;
|
|
43
45
|
}
|
|
44
46
|
function forEachEntry(object, iterator) {
|
|
45
|
-
Object.entries(object).forEach(
|
|
46
|
-
([key, item], index, pairs) => iterator(key, item, index, pairs, object)
|
|
47
|
-
);
|
|
47
|
+
Object.entries(object).forEach(([key, item], index, pairs) => iterator(key, item, index, pairs, object));
|
|
48
48
|
}
|
|
49
49
|
var entries = Object.entries;
|
|
50
50
|
var keys = Object.keys;
|
|
@@ -70,17 +70,14 @@ function createMicrotask(fn) {
|
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
function createProxy(traps) {
|
|
73
|
-
return new Proxy(
|
|
74
|
-
|
|
75
|
-
{
|
|
76
|
-
|
|
77
|
-
set: (
|
|
78
|
-
|
|
79
|
-
(_a = traps.set) == null ? void 0 : _a.call(traps, k, v);
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
73
|
+
return new Proxy({}, {
|
|
74
|
+
get: (_, k) => traps.get(k),
|
|
75
|
+
set: (_, k, v) => {
|
|
76
|
+
var _a;
|
|
77
|
+
(_a = traps.set) == null ? void 0 : _a.call(traps, k, v);
|
|
78
|
+
return false;
|
|
82
79
|
}
|
|
83
|
-
);
|
|
80
|
+
});
|
|
84
81
|
}
|
|
85
82
|
var createTrigger = isDev ? () => createSignal(void 0, { equals: false, name: "trigger" }) : () => createSignal(void 0, { equals: false });
|
|
86
83
|
function dirtyTriggerCache(key) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solid-primitives/utils",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.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,6 +21,11 @@
|
|
|
21
21
|
"files": [
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsup",
|
|
26
|
+
"test": "uvu -r solid-register",
|
|
27
|
+
"test:watch": "watchlist src test -- npm test"
|
|
28
|
+
},
|
|
24
29
|
"keywords": [
|
|
25
30
|
"utilities",
|
|
26
31
|
"reactivity",
|
|
@@ -28,20 +33,15 @@
|
|
|
28
33
|
"primitives"
|
|
29
34
|
],
|
|
30
35
|
"devDependencies": {
|
|
31
|
-
"jsdom": "^
|
|
36
|
+
"jsdom": "^20.0.0",
|
|
32
37
|
"prettier": "^2.7.1",
|
|
33
38
|
"solid-register": "^0.2.5",
|
|
34
39
|
"tslib": "^2.4.0",
|
|
35
|
-
"tsup": "^6.1
|
|
40
|
+
"tsup": "^6.2.1",
|
|
36
41
|
"uvu": "^0.5.6",
|
|
37
42
|
"watchlist": "^0.3.1"
|
|
38
43
|
},
|
|
39
44
|
"peerDependencies": {
|
|
40
45
|
"solid-js": "^1.4.1"
|
|
41
|
-
},
|
|
42
|
-
"scripts": {
|
|
43
|
-
"build": "tsup",
|
|
44
|
-
"test": "uvu -r solid-register",
|
|
45
|
-
"test:watch": "watchlist src test -- npm test"
|
|
46
46
|
}
|
|
47
|
-
}
|
|
47
|
+
}
|