@varlet/shared 3.0.2 → 3.0.4

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.cjs CHANGED
@@ -55,6 +55,7 @@ __export(src_exports, {
55
55
  getStyle: () => getStyle,
56
56
  hasOwn: () => hasOwn,
57
57
  inBrowser: () => inBrowser,
58
+ inMobile: () => inMobile,
58
59
  inViewport: () => inViewport,
59
60
  isArray: () => isArray,
60
61
  isBoolean: () => isBoolean,
@@ -102,6 +103,7 @@ var isEmpty = (val) => val === void 0 || val === null || val === "" || Array.isA
102
103
  var isWindow = (val) => val === window;
103
104
  var supportTouch = () => inBrowser() && "ontouchstart" in window;
104
105
  var inBrowser = () => typeof window !== "undefined";
106
+ var inMobile = () => inBrowser() && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
105
107
  var { hasOwnProperty } = Object.prototype;
106
108
  var hasOwn = (val, key) => hasOwnProperty.call(val, key);
107
109
 
@@ -321,6 +323,7 @@ function createNamespaceFn(namespace) {
321
323
  getStyle,
322
324
  hasOwn,
323
325
  inBrowser,
326
+ inMobile,
324
327
  inViewport,
325
328
  isArray,
326
329
  isBoolean,
package/lib/index.d.cts CHANGED
@@ -38,6 +38,7 @@ declare const isEmpty: (val: unknown) => boolean;
38
38
  declare const isWindow: (val: unknown) => val is Window;
39
39
  declare const supportTouch: () => boolean;
40
40
  declare const inBrowser: () => boolean;
41
+ declare const inMobile: () => boolean;
41
42
  declare const hasOwn: (val: object, key: string | symbol) => key is never;
42
43
 
43
44
  declare const toNumber: (val: number | string | boolean | undefined | null) => number;
@@ -54,4 +55,4 @@ declare function createNamespaceFn<N extends string>(namespace: N): <C extends s
54
55
  classes: (...classes: Classes) => any[];
55
56
  };
56
57
 
57
- export { BEM, ClassName, Classes, bigCamelize, call, camelize, cancelAnimationFrame, clamp, clampArrayRange, classes, createNamespaceFn, debounce, doubleRaf, find, getGlobalThis, getRect, getScrollLeft, getScrollTop, getStyle, hasOwn, inBrowser, inViewport, isArray, isBoolean, isEmpty, isFunction, isNumber, isNumeric, isObject, isPlainObject, isString, isURL, isWindow, kebabCase, normalizeToArray, preventDefault, raf, removeArrayBlank, removeItem, requestAnimationFrame, supportTouch, throttle, toDataURL, toNumber, toggleItem, uniq };
58
+ export { BEM, ClassName, Classes, bigCamelize, call, camelize, cancelAnimationFrame, clamp, clampArrayRange, classes, createNamespaceFn, debounce, doubleRaf, find, getGlobalThis, getRect, getScrollLeft, getScrollTop, getStyle, hasOwn, inBrowser, inMobile, inViewport, isArray, isBoolean, isEmpty, isFunction, isNumber, isNumeric, isObject, isPlainObject, isString, isURL, isWindow, kebabCase, normalizeToArray, preventDefault, raf, removeArrayBlank, removeItem, requestAnimationFrame, supportTouch, throttle, toDataURL, toNumber, toggleItem, uniq };
package/lib/index.d.ts CHANGED
@@ -38,6 +38,7 @@ declare const isEmpty: (val: unknown) => boolean;
38
38
  declare const isWindow: (val: unknown) => val is Window;
39
39
  declare const supportTouch: () => boolean;
40
40
  declare const inBrowser: () => boolean;
41
+ declare const inMobile: () => boolean;
41
42
  declare const hasOwn: (val: object, key: string | symbol) => key is never;
42
43
 
43
44
  declare const toNumber: (val: number | string | boolean | undefined | null) => number;
@@ -54,4 +55,4 @@ declare function createNamespaceFn<N extends string>(namespace: N): <C extends s
54
55
  classes: (...classes: Classes) => any[];
55
56
  };
56
57
 
57
- export { BEM, ClassName, Classes, bigCamelize, call, camelize, cancelAnimationFrame, clamp, clampArrayRange, classes, createNamespaceFn, debounce, doubleRaf, find, getGlobalThis, getRect, getScrollLeft, getScrollTop, getStyle, hasOwn, inBrowser, inViewport, isArray, isBoolean, isEmpty, isFunction, isNumber, isNumeric, isObject, isPlainObject, isString, isURL, isWindow, kebabCase, normalizeToArray, preventDefault, raf, removeArrayBlank, removeItem, requestAnimationFrame, supportTouch, throttle, toDataURL, toNumber, toggleItem, uniq };
58
+ export { BEM, ClassName, Classes, bigCamelize, call, camelize, cancelAnimationFrame, clamp, clampArrayRange, classes, createNamespaceFn, debounce, doubleRaf, find, getGlobalThis, getRect, getScrollLeft, getScrollTop, getStyle, hasOwn, inBrowser, inMobile, inViewport, isArray, isBoolean, isEmpty, isFunction, isNumber, isNumeric, isObject, isPlainObject, isString, isURL, isWindow, kebabCase, normalizeToArray, preventDefault, raf, removeArrayBlank, removeItem, requestAnimationFrame, supportTouch, throttle, toDataURL, toNumber, toggleItem, uniq };
package/lib/index.js CHANGED
@@ -37,6 +37,7 @@ var isEmpty = (val) => val === void 0 || val === null || val === "" || Array.isA
37
37
  var isWindow = (val) => val === window;
38
38
  var supportTouch = () => inBrowser() && "ontouchstart" in window;
39
39
  var inBrowser = () => typeof window !== "undefined";
40
+ var inMobile = () => inBrowser() && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
40
41
  var { hasOwnProperty } = Object.prototype;
41
42
  var hasOwn = (val, key) => hasOwnProperty.call(val, key);
42
43
 
@@ -255,6 +256,7 @@ export {
255
256
  getStyle,
256
257
  hasOwn,
257
258
  inBrowser,
259
+ inMobile,
258
260
  inViewport,
259
261
  isArray,
260
262
  isBoolean,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/shared",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "type": "module",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.js",