@solid-primitives/utils 2.0.0 → 2.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 +4 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -78,8 +78,10 @@ function isObject(value) {
|
|
|
78
78
|
var compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
79
79
|
function chain(callbacks) {
|
|
80
80
|
return (...args) => {
|
|
81
|
-
for (const callback of callbacks)
|
|
82
|
-
callback
|
|
81
|
+
for (const callback of callbacks) {
|
|
82
|
+
if (typeof callback === "function")
|
|
83
|
+
callback(...args);
|
|
84
|
+
}
|
|
83
85
|
};
|
|
84
86
|
}
|
|
85
87
|
var clamp = (n, min, max) => Math.min(Math.max(n, min), max);
|
package/dist/index.d.ts
CHANGED
|
@@ -111,7 +111,7 @@ declare const compare: (a: any, b: any) => number;
|
|
|
111
111
|
* Returns a function that will call all functions in the order they were chained with the same arguments.
|
|
112
112
|
*/
|
|
113
113
|
declare function chain<Args extends [] | any[]>(callbacks: {
|
|
114
|
-
[Symbol.iterator](): IterableIterator<(...args: Args) => any>;
|
|
114
|
+
[Symbol.iterator](): IterableIterator<((...args: Args) => any) | undefined>;
|
|
115
115
|
}): (...args: Args) => void;
|
|
116
116
|
declare const clamp: (n: number, min: number, max: number) => number;
|
|
117
117
|
/**
|
package/dist/index.js
CHANGED
|
@@ -30,8 +30,10 @@ function isObject(value) {
|
|
|
30
30
|
var compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
31
31
|
function chain(callbacks) {
|
|
32
32
|
return (...args) => {
|
|
33
|
-
for (const callback of callbacks)
|
|
34
|
-
callback
|
|
33
|
+
for (const callback of callbacks) {
|
|
34
|
+
if (typeof callback === "function")
|
|
35
|
+
callback(...args);
|
|
36
|
+
}
|
|
35
37
|
};
|
|
36
38
|
}
|
|
37
39
|
var clamp = (n, min, max) => Math.min(Math.max(n, min), max);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solid-primitives/utils",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.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",
|