@varlet/shared 2.18.3-alpha.1699111361708 → 2.18.3

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 CHANGED
@@ -27,6 +27,7 @@ declare function call<P extends any[], R>(fn?: ((...arg: P) => R) | ((...arg: P)
27
27
  declare const isString: (val: unknown) => val is string;
28
28
  declare const isBoolean: (val: unknown) => val is boolean;
29
29
  declare const isNumber: (val: unknown) => val is number;
30
+ declare const isNumeric: (val: unknown) => val is string | number;
30
31
  declare const isPlainObject: (val: unknown) => val is Record<string, any>;
31
32
  declare const isObject: (val: unknown) => val is Record<string, any>;
32
33
  declare const isFunction: (val: unknown) => val is Function;
@@ -52,4 +53,4 @@ declare function createNamespaceFn<N extends string>(namespace: N): <C extends s
52
53
  classes: (...classes: Classes) => any[];
53
54
  };
54
55
 
55
- 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, isObject, isPlainObject, isString, isURL, isWindow, kebabCase, normalizeToArray, preventDefault, raf, removeItem, requestAnimationFrame, supportTouch, throttle, toDataURL, toNumber, toggleItem, uniq };
56
+ 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, removeItem, requestAnimationFrame, supportTouch, throttle, toDataURL, toNumber, toggleItem, uniq };
package/lib/index.js CHANGED
@@ -22,6 +22,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
22
  var isString = (val) => typeof val === "string";
23
23
  var isBoolean = (val) => typeof val === "boolean";
24
24
  var isNumber = (val) => typeof val === "number";
25
+ var isNumeric = (val) => isNumber(val) || isString(val) && /^\d+$/.test(val);
25
26
  var isPlainObject = (val) => Object.prototype.toString.call(val) === "[object Object]";
26
27
  var isObject = (val) => typeof val === "object" && val !== null;
27
28
  var isFunction = (val) => typeof val === "function";
@@ -258,6 +259,7 @@ export {
258
259
  isEmpty,
259
260
  isFunction,
260
261
  isNumber,
262
+ isNumeric,
261
263
  isObject,
262
264
  isPlainObject,
263
265
  isString,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/shared",
3
- "version": "2.18.3-alpha.1699111361708",
3
+ "version": "2.18.3",
4
4
  "type": "module",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.js",