@varlet/shared 2.18.0 → 2.18.2-alpha.1698728560863
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/lib/index.d.ts +2 -1
- package/lib/index.js +3 -0
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ declare const isEmpty: (val: unknown) => boolean;
|
|
|
32
32
|
declare const isWindow: (val: unknown) => val is Window;
|
|
33
33
|
declare const supportTouch: () => boolean;
|
|
34
34
|
declare const inBrowser: () => boolean;
|
|
35
|
+
declare const hasOwn: (val: object, key: string | symbol) => key is never;
|
|
35
36
|
|
|
36
37
|
declare const toNumber: (val: number | string | boolean | undefined | null) => number;
|
|
37
38
|
declare const clamp: (num: number, min: number, max: number) => number;
|
|
@@ -41,4 +42,4 @@ declare const bigCamelize: (s: string) => string;
|
|
|
41
42
|
declare const camelize: (s: string) => string;
|
|
42
43
|
declare const kebabCase: (s: string) => string;
|
|
43
44
|
|
|
44
|
-
export { bigCamelize, camelize, cancelAnimationFrame, clamp, clampArrayRange, debounce, doubleRaf, find, getGlobalThis, getRect, getScrollLeft, getScrollTop, getStyle, inBrowser, inViewport, isArray, isBoolean, isEmpty, isFunction, isNumber, isObject, isPlainObject, isString, isURL, isWindow, kebabCase, normalizeToArray, preventDefault, raf, removeItem, requestAnimationFrame, supportTouch, throttle, toDataURL, toNumber, toggleItem, uniq };
|
|
45
|
+
export { bigCamelize, camelize, cancelAnimationFrame, clamp, clampArrayRange, debounce, doubleRaf, find, getGlobalThis, getRect, getScrollLeft, getScrollTop, getStyle, hasOwn, inBrowser, inViewport, isArray, isBoolean, isEmpty, isFunction, isNumber, isObject, isPlainObject, isString, isURL, isWindow, kebabCase, normalizeToArray, preventDefault, raf, removeItem, requestAnimationFrame, supportTouch, throttle, toDataURL, toNumber, toggleItem, uniq };
|
package/lib/index.js
CHANGED
|
@@ -36,6 +36,8 @@ var isEmpty = (val) => val === void 0 || val === null || val === "" || Array.isA
|
|
|
36
36
|
var isWindow = (val) => val === window;
|
|
37
37
|
var supportTouch = () => inBrowser() && "ontouchstart" in window;
|
|
38
38
|
var inBrowser = () => typeof window !== "undefined";
|
|
39
|
+
var { hasOwnProperty } = Object.prototype;
|
|
40
|
+
var hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
|
39
41
|
|
|
40
42
|
// src/array.ts
|
|
41
43
|
var uniq = (arr) => [...new Set(arr)];
|
|
@@ -211,6 +213,7 @@ export {
|
|
|
211
213
|
getScrollLeft,
|
|
212
214
|
getScrollTop,
|
|
213
215
|
getStyle,
|
|
216
|
+
hasOwn,
|
|
214
217
|
inBrowser,
|
|
215
218
|
inViewport,
|
|
216
219
|
isArray,
|