@sheinx/hooks 3.4.0-beta.2 → 3.4.0-beta.4

Sign up to get free protection for your applications and to get access to all the features.
package/cjs/utils/is.d.ts CHANGED
@@ -21,6 +21,7 @@ export declare const isPromise: (p: unknown) => unknown;
21
21
  export declare const isNan: (a: unknown) => boolean;
22
22
  export declare const isEmpty: (val: unknown) => boolean;
23
23
  export declare const isLink: (el: unknown) => el is React.ReactElement<any, string | React.JSXElementConstructor<any>>;
24
+ export declare function isNamedComponent(type: any): type is React.ForwardRefExoticComponent<unknown>;
24
25
  export declare const isMacOS: () => boolean;
25
26
  export declare const isFirefox: () => boolean;
26
27
  export declare const isChromeLowerThan: (version: number) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["is.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,wBAAgB,SAAS,YAExB;AASD,eAAO,MAAM,OAAO,4BAAgB,CAAC;AACrC,eAAO,MAAM,QAAQ,QAAS,OAAO,sBACc,CAAC;AACpD,eAAO,MAAM,MAAM,QAAS,OAAO,gBAAqC,CAAC;AACzE,eAAO,MAAM,SAAS,QAAS,OAAO,mBAA2C,CAAC;AAClF,eAAO,MAAM,OAAO,QAAS,OAAO,KAAG,OAA+B,CAAC;AACvE,eAAO,MAAM,QAAQ,MAAO,OAAO,gBAAuC,CAAC;AAC3E,eAAO,MAAM,QAAQ,QAAS,OAAO,KAAG,OAAgC,CAAC;AACzE,eAAO,MAAM,QAAQ,MAAO,OAAO,gBAAuC,CAAC;AAC3E,eAAO,MAAM,WAAW,QAAS,GAAG,qBAAwC,CAAC;AAC7E,eAAO,MAAM,KAAK,QAjBsB,OAAO,mBAiBb,CAAC;AACnC,eAAO,MAAM,KAAK,QAlBsB,OAAO,mBAkBb,CAAC;AACnC,eAAO,MAAM,QA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,OAAO,gBAAuC,CAAC;AAC3E,eAAO,MAAM,WAAW,QAAS,GAAG,qBAAwC,CAAC;AAC7E,eAAO,MAAM,KAAK,QAjBsB,OAAO,mBAiBb,CAAC;AACnC,eAAO,MAAM,KAAK,QAlBsB,OAAO,mBAkBb,CAAC;AACnC,eAAO,MAAM,QAAQ,QAAS,OAAO,KAAG,OAUvC,CAAC;AACF,eAAO,MAAM,eAAe,QAAS,OAAO,yBAE3C,CAAC;AACF,eAAO,MAAM,WAAW,QAAS,OAAO,KAAG,OAS1C,CAAC;AAEF,eAAO,MAAM,MAAM,MAAO,OAAO,kBAA2C,CAAC;AAE7E,eAAO,MAAM,SAAS,MAAO,OAAO,YACiC,CAAC;AAGtE,eAAO,MAAM,KAAK,MAAO,OAAO,KAAG,OAAkB,CAAC;AAEtD,eAAO,MAAM,OAAO,QAAS,OAAO,KAAG,OActC,CAAC;AAEF,eAAO,MAAM,MAAM,OAAQ,OAAO,6EASjC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,KAAK,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAE5F;AAED,eAAO,MAAM,OAAO,QAAO,OACqC,CAAC;AAEjE,eAAO,MAAM,SAAS,QAAO,OAG5B,CAAC;AAEF,eAAO,MAAM,iBAAiB,YAAa,MAAM,KAAG,OASnD,CAAC;AAEF,wBAAgB,YAAY,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,IAAI,WAAW,CAQjE"}
package/cjs/utils/is.js CHANGED
@@ -7,7 +7,9 @@ exports.isBoolean = exports.isArray = void 0;
7
7
  exports.isBrowser = isBrowser;
8
8
  exports.isDate = exports.isChromeLowerThan = exports.isBuffer = void 0;
9
9
  exports.isDomElement = isDomElement;
10
- exports.isUndefined = exports.isUnMatchedData = exports.isString = exports.isSet = exports.isRegexp = exports.isPromise = exports.isObject = exports.isNumber = exports.isNan = exports.isMergeable = exports.isMap = exports.isMacOS = exports.isLink = exports.isFunc = exports.isFirefox = exports.isError = exports.isEmpty = void 0;
10
+ exports.isMergeable = exports.isMap = exports.isMacOS = exports.isLink = exports.isFunc = exports.isFirefox = exports.isError = exports.isEmpty = void 0;
11
+ exports.isNamedComponent = isNamedComponent;
12
+ exports.isUndefined = exports.isUnMatchedData = exports.isString = exports.isSet = exports.isRegexp = exports.isPromise = exports.isObject = exports.isNumber = exports.isNan = void 0;
11
13
  var _react = _interopRequireDefault(require("react"));
12
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
15
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
@@ -96,6 +98,9 @@ var isLink = exports.isLink = function isLink(el) {
96
98
  }
97
99
  return false;
98
100
  };
101
+ function isNamedComponent(type) {
102
+ return (isObject(type) || isFunc(type)) && type.hasOwnProperty('displayName');
103
+ }
99
104
  var isMacOS = exports.isMacOS = function isMacOS() {
100
105
  return isBrowser() && /macintosh|mac os x/i.test(navigator.userAgent);
101
106
  };
package/esm/utils/is.d.ts CHANGED
@@ -21,6 +21,7 @@ export declare const isPromise: (p: unknown) => unknown;
21
21
  export declare const isNan: (a: unknown) => boolean;
22
22
  export declare const isEmpty: (val: unknown) => boolean;
23
23
  export declare const isLink: (el: unknown) => el is React.ReactElement<any, string | React.JSXElementConstructor<any>>;
24
+ export declare function isNamedComponent(type: any): type is React.ForwardRefExoticComponent<unknown>;
24
25
  export declare const isMacOS: () => boolean;
25
26
  export declare const isFirefox: () => boolean;
26
27
  export declare const isChromeLowerThan: (version: number) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["is.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,aA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F,eAAO,MAAM,MAAM,OAAQ,OAAO,6EASjC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,KAAK,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAE5F;AAED,eAAO,MAAM,OAAO,QAAO,OACqC,CAAC;AAEjE,eAAO,MAAM,SAAS,QAAO,OAG5B,CAAC;AAEF,eAAO,MAAM,iBAAiB,YAAa,MAAM,KAAG,OASnD,CAAC;AAEF,wBAAgB,YAAY,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,IAAI,WAAW,CAQjE"}
package/esm/utils/is.js CHANGED
@@ -85,6 +85,9 @@ export var isLink = function isLink(el) {
85
85
  }
86
86
  return false;
87
87
  };
88
+ export function isNamedComponent(type) {
89
+ return (isObject(type) || isFunc(type)) && type.hasOwnProperty('displayName');
90
+ }
88
91
  export var isMacOS = function isMacOS() {
89
92
  return isBrowser() && /macintosh|mac os x/i.test(navigator.userAgent);
90
93
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.4.0-beta.2",
3
+ "version": "3.4.0-beta.4",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",