@arms/rum-core 0.0.28 → 0.0.29

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/utils/is.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export type IsFnHelper<T = unknown> = (value: unknown) => value is T;
2
2
  export declare function isTypeof<T = unknown>(value: unknown, type: string): value is T;
3
3
  export declare const isFunction: (func: any) => boolean;
4
- export declare const isUndefined: IsFnHelper<undefined>;
5
4
  export declare const isString: IsFnHelper<string>;
6
5
  export declare function isToString<T = unknown>(value: unknown, type: string): value is T;
7
6
  export declare const isArray: IsFnHelper<unknown[]>;
@@ -10,3 +9,4 @@ export declare const isBoolean: IsFnHelper<boolean>;
10
9
  export declare const isNumber: IsFnHelper<number | bigint>;
11
10
  export declare const isNull: IsFnHelper<null>;
12
11
  export declare const isObject: IsFnHelper<object>;
12
+ export declare function isZero(...args: number[]): boolean;
package/lib/utils/is.js CHANGED
@@ -4,16 +4,16 @@ exports.__esModule = true;
4
4
  exports.isString = exports.isRegExp = exports.isObject = exports.isNumber = exports.isNull = exports.isFunction = exports.isBoolean = exports.isArray = void 0;
5
5
  exports.isToString = isToString;
6
6
  exports.isTypeof = isTypeof;
7
- exports.isUndefined = void 0;
7
+ exports.isZero = isZero;
8
8
  function isTypeof(value, type) {
9
9
  return typeof value === type;
10
10
  }
11
11
  var isFunction = exports.isFunction = function isFunction(func) {
12
12
  return typeof func === 'function';
13
13
  };
14
- var isUndefined = exports.isUndefined = function isUndefined(value) {
15
- return isTypeof(value, 'undefined');
16
- };
14
+
15
+ // export const isUndefined = ((value) => isTypeof(value, 'undefined')) as IsFnHelper<undefined>;
16
+
17
17
  var isString = exports.isString = function isString(value) {
18
18
  return isTypeof(value, 'string');
19
19
  };
@@ -37,4 +37,10 @@ var isNull = exports.isNull = function isNull(value) {
37
37
  };
38
38
  var isObject = exports.isObject = function isObject(value) {
39
39
  return !isNull(value) && isTypeof(value, 'object');
40
- };
40
+ };
41
+ function isZero() {
42
+ for (var i = 0; i < arguments.length; i++) {
43
+ if ((i < 0 || arguments.length <= i ? undefined : arguments[i]) !== 0) return false;
44
+ }
45
+ return true;
46
+ }
@@ -38,7 +38,7 @@ function urlMatch(url, list) {
38
38
  if (!(0, _is.isArray)(list)) {
39
39
  list = [list];
40
40
  }
41
- var rules = [/https?:\/\/.*rum|retcode\.aliyuncs\.com/, /https?:\/\/.*log-global\.aliyuncs\.com/, /https?:\/\/.*\.mmstat\.com/, /data:(.+?)(;base64)?,(.+)$/].concat(list);
41
+ var rules = [/^(https?:)?\/\/.*rum|retcode|log-global|log\.aliyuncs\.com/, /^(https?:)?\/\/.*\.mmstat\.com/, /^(https?:)?\/\/.*hm\.baidu\.com/, /^(https?:)?\/\/.*google-analytics\.com/, /data:(.+?)(;base64)?,(.+)$/].concat(list);
42
42
  return matchList(rules, url);
43
43
  } catch (e) {
44
44
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arms/rum-core",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "description": "arms rum javascript sdk core",
5
5
  "author": "guangli.fj <guangli.fj@alibaba-inc.com>",
6
6
  "license": "ISC",