@splendidlabz/utils 1.15.0 → 1.15.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.
|
@@ -210,10 +210,11 @@ function preferHorizontalScroll(node, props = {}) {
|
|
|
210
210
|
currentSnapType: null,
|
|
211
211
|
snapTimeoutID: null
|
|
212
212
|
};
|
|
213
|
+
const cssSnapDelay = parseFloat(getCSSVar(node, "--scroll-snap-delay"));
|
|
213
214
|
const options = {
|
|
214
215
|
...DEFAULT_OPTIONS,
|
|
215
216
|
...omitEmpty({
|
|
216
|
-
scrollSnapDelay:
|
|
217
|
+
scrollSnapDelay: Number.isNaN(cssSnapDelay) ? void 0 : cssSnapDelay
|
|
217
218
|
}),
|
|
218
219
|
...omitEmpty(props)
|
|
219
220
|
};
|
|
@@ -88,10 +88,11 @@ function preferHorizontalScroll(node, props = {}) {
|
|
|
88
88
|
currentSnapType: null,
|
|
89
89
|
snapTimeoutID: null
|
|
90
90
|
};
|
|
91
|
+
const cssSnapDelay = parseFloat(getCSSVar(node, "--scroll-snap-delay"));
|
|
91
92
|
const options = {
|
|
92
93
|
...DEFAULT_OPTIONS,
|
|
93
94
|
...omitEmpty({
|
|
94
|
-
scrollSnapDelay:
|
|
95
|
+
scrollSnapDelay: Number.isNaN(cssSnapDelay) ? void 0 : cssSnapDelay
|
|
95
96
|
}),
|
|
96
97
|
...omitEmpty(props)
|
|
97
98
|
};
|
package/dist/cjs/dom/index.cjs
CHANGED
|
@@ -358,10 +358,11 @@ function preferHorizontalScroll(node, props = {}) {
|
|
|
358
358
|
currentSnapType: null,
|
|
359
359
|
snapTimeoutID: null
|
|
360
360
|
};
|
|
361
|
+
const cssSnapDelay = parseFloat(getCSSVar(node, "--scroll-snap-delay"));
|
|
361
362
|
const options = {
|
|
362
363
|
...DEFAULT_OPTIONS,
|
|
363
364
|
...omitEmpty({
|
|
364
|
-
scrollSnapDelay:
|
|
365
|
+
scrollSnapDelay: Number.isNaN(cssSnapDelay) ? void 0 : cssSnapDelay
|
|
365
366
|
}),
|
|
366
367
|
...omitEmpty(props)
|
|
367
368
|
};
|
|
@@ -11,10 +11,11 @@ function preferHorizontalScroll(node, props = {}) {
|
|
|
11
11
|
currentSnapType: null,
|
|
12
12
|
snapTimeoutID: null
|
|
13
13
|
};
|
|
14
|
+
const cssSnapDelay = parseFloat(getCSSVar(node, "--scroll-snap-delay"));
|
|
14
15
|
const options = {
|
|
15
16
|
...DEFAULT_OPTIONS,
|
|
16
17
|
...omitEmpty({
|
|
17
|
-
scrollSnapDelay:
|
|
18
|
+
scrollSnapDelay: Number.isNaN(cssSnapDelay) ? void 0 : cssSnapDelay
|
|
18
19
|
}),
|
|
19
20
|
...omitEmpty(props)
|
|
20
21
|
};
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Drop the keys holding nothing — null, undefined, an empty string, an empty object or an empty array.
|
|
3
3
|
*
|
|
4
|
+
* @template {object} T
|
|
4
5
|
* @overload
|
|
5
|
-
* @param {
|
|
6
|
+
* @param {T} obj Object to filter.
|
|
6
7
|
* @param {object} [options]
|
|
7
8
|
* @param {boolean} [options.shallow=false] Leave nested values alone.
|
|
8
9
|
* @param {boolean} [options.omitFalsey=false] Drop 0, false and NaN too.
|
|
9
|
-
* @returns {
|
|
10
|
+
* @returns {T extends readonly (infer E)[] ? NonNullable<E>[] : Partial<T>} A copy without the empty keys. An array answers with an array, its element type stripped of `null` and `undefined` — the two entries this always drops.
|
|
10
11
|
*/
|
|
11
|
-
declare function omitEmpty(obj:
|
|
12
|
+
declare function omitEmpty<T extends unknown>(obj: T, options?: {
|
|
12
13
|
shallow?: boolean;
|
|
13
14
|
omitFalsey?: boolean;
|
|
14
|
-
}):
|
|
15
|
+
}): T extends readonly (infer E)[] ? NonNullable<E>[] : Partial<T>;
|
|
15
16
|
/**
|
|
16
17
|
* Drop the keys holding nothing.
|
|
17
18
|
*
|
|
19
|
+
* @template {object} T
|
|
18
20
|
* @overload
|
|
19
|
-
* @param {
|
|
21
|
+
* @param {T} obj Object to filter.
|
|
20
22
|
* @param {boolean} shallow Leave nested values alone.
|
|
21
|
-
* @returns {
|
|
23
|
+
* @returns {T extends readonly (infer E)[] ? NonNullable<E>[] : Partial<T>} A copy without the empty keys.
|
|
22
24
|
* @deprecated Pass `{ shallow: true }` instead. The boolean goes in 2.0.0.
|
|
23
25
|
*/
|
|
24
|
-
declare function omitEmpty(obj:
|
|
26
|
+
declare function omitEmpty<T extends unknown>(obj: T, shallow: boolean): T extends readonly (infer E)[] ? NonNullable<E>[] : Partial<T>;
|
|
25
27
|
|
|
26
28
|
export { omitEmpty };
|