@deppon/deppon-monitor-utils 2.2.1 → 2.2.2
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/LICENSE +1 -1
- package/es/index.d.ts +76 -76
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
package/es/index.d.ts
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import UAParser from 'ua-parser-js';
|
|
2
|
-
import { ErrorLevelEnum, ErrorTypeEnum, ReportDataType } from '@deppon/deppon-monitor-shared';
|
|
3
|
-
declare function GetDeviceInfo(): {
|
|
4
|
-
os: UAParser.IOS;
|
|
5
|
-
browser: UAParser.IBrowser;
|
|
6
|
-
device: {
|
|
7
|
-
vendor: string;
|
|
8
|
-
type: string;
|
|
9
|
-
model: string;
|
|
10
|
-
};
|
|
11
|
-
engine: UAParser.IEngine;
|
|
12
|
-
userAgent: string;
|
|
13
|
-
};
|
|
14
|
-
export declare const nativeToString: () => string;
|
|
15
|
-
/**
|
|
16
|
-
* 检测变量类型
|
|
17
|
-
* @param type
|
|
18
|
-
*/
|
|
19
|
-
export declare const variableTypeDetection: {
|
|
20
|
-
isNumber: (value: any) => boolean;
|
|
21
|
-
isString: (value: any) => boolean;
|
|
22
|
-
isBoolean: (value: any) => boolean;
|
|
23
|
-
isNull: (value: any) => boolean;
|
|
24
|
-
isUndefined: (value: any) => boolean;
|
|
25
|
-
isSymbol: (value: any) => boolean;
|
|
26
|
-
isFunction: (value: any) => boolean;
|
|
27
|
-
isObject: (value: any) => boolean;
|
|
28
|
-
isArray: (value: any) => boolean;
|
|
29
|
-
isProcess: (value: any) => boolean;
|
|
30
|
-
isWindow: (value: any) => boolean;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* 检查是否是空对象
|
|
34
|
-
* @param obj 待检测的对象
|
|
35
|
-
*/
|
|
36
|
-
export declare function isEmptyObject(obj: Record<string, any>): boolean;
|
|
37
|
-
export declare function isEmpty(wat: any): boolean;
|
|
38
|
-
export declare function isInstanceOf(wat: any, base: any): boolean;
|
|
39
|
-
export declare function isExistProperty(obj: Record<string, any>, key: string | number | symbol): boolean;
|
|
40
|
-
export declare function isError(wat: any): boolean;
|
|
41
|
-
export declare function getBigVersion(version: string): number;
|
|
42
|
-
export declare function generateUUID(): string;
|
|
43
|
-
export declare function getLines(stack: string): string;
|
|
44
|
-
export declare function getNetworkType(): string;
|
|
45
|
-
export declare function getHref(): string;
|
|
46
|
-
export declare function getTimestamp(): number;
|
|
47
|
-
export declare function unknownToString(target: unknown): string;
|
|
48
|
-
export declare function handleNotErrorInstance(message: string, filename: string, lineno: number, colno: number): {
|
|
49
|
-
url: string;
|
|
50
|
-
name: ErrorLevelEnum;
|
|
51
|
-
message: string;
|
|
52
|
-
time: number;
|
|
53
|
-
stack: {
|
|
54
|
-
url: string;
|
|
55
|
-
func: ErrorTypeEnum;
|
|
56
|
-
args: ErrorTypeEnum;
|
|
57
|
-
line: number;
|
|
58
|
-
col: number;
|
|
59
|
-
}[];
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* 解析error的stack,并返回args、column、line、func、url:
|
|
63
|
-
* @param ex
|
|
64
|
-
*/
|
|
65
|
-
export declare function extractErrorStack(ex: any): ReportDataType;
|
|
66
|
-
export declare class Queue {
|
|
67
|
-
private stack;
|
|
68
|
-
private isFlushing;
|
|
69
|
-
private micro;
|
|
70
|
-
constructor();
|
|
71
|
-
addFn(fn: (...arg: any) => any): void;
|
|
72
|
-
clear(): void;
|
|
73
|
-
getStack(): any[];
|
|
74
|
-
flushStack(): void;
|
|
75
|
-
}
|
|
76
|
-
export { GetDeviceInfo };
|
|
1
|
+
import UAParser from 'ua-parser-js';
|
|
2
|
+
import { ErrorLevelEnum, ErrorTypeEnum, ReportDataType } from '@deppon/deppon-monitor-shared';
|
|
3
|
+
declare function GetDeviceInfo(): {
|
|
4
|
+
os: UAParser.IOS;
|
|
5
|
+
browser: UAParser.IBrowser;
|
|
6
|
+
device: {
|
|
7
|
+
vendor: string;
|
|
8
|
+
type: string;
|
|
9
|
+
model: string;
|
|
10
|
+
};
|
|
11
|
+
engine: UAParser.IEngine;
|
|
12
|
+
userAgent: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const nativeToString: () => string;
|
|
15
|
+
/**
|
|
16
|
+
* 检测变量类型
|
|
17
|
+
* @param type
|
|
18
|
+
*/
|
|
19
|
+
export declare const variableTypeDetection: {
|
|
20
|
+
isNumber: (value: any) => boolean;
|
|
21
|
+
isString: (value: any) => boolean;
|
|
22
|
+
isBoolean: (value: any) => boolean;
|
|
23
|
+
isNull: (value: any) => boolean;
|
|
24
|
+
isUndefined: (value: any) => boolean;
|
|
25
|
+
isSymbol: (value: any) => boolean;
|
|
26
|
+
isFunction: (value: any) => boolean;
|
|
27
|
+
isObject: (value: any) => boolean;
|
|
28
|
+
isArray: (value: any) => boolean;
|
|
29
|
+
isProcess: (value: any) => boolean;
|
|
30
|
+
isWindow: (value: any) => boolean;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* 检查是否是空对象
|
|
34
|
+
* @param obj 待检测的对象
|
|
35
|
+
*/
|
|
36
|
+
export declare function isEmptyObject(obj: Record<string, any>): boolean;
|
|
37
|
+
export declare function isEmpty(wat: any): boolean;
|
|
38
|
+
export declare function isInstanceOf(wat: any, base: any): boolean;
|
|
39
|
+
export declare function isExistProperty(obj: Record<string, any>, key: string | number | symbol): boolean;
|
|
40
|
+
export declare function isError(wat: any): boolean;
|
|
41
|
+
export declare function getBigVersion(version: string): number;
|
|
42
|
+
export declare function generateUUID(): string;
|
|
43
|
+
export declare function getLines(stack: string): string;
|
|
44
|
+
export declare function getNetworkType(): string;
|
|
45
|
+
export declare function getHref(): string;
|
|
46
|
+
export declare function getTimestamp(): number;
|
|
47
|
+
export declare function unknownToString(target: unknown): string;
|
|
48
|
+
export declare function handleNotErrorInstance(message: string, filename: string, lineno: number, colno: number): {
|
|
49
|
+
url: string;
|
|
50
|
+
name: ErrorLevelEnum;
|
|
51
|
+
message: string;
|
|
52
|
+
time: number;
|
|
53
|
+
stack: {
|
|
54
|
+
url: string;
|
|
55
|
+
func: ErrorTypeEnum;
|
|
56
|
+
args: ErrorTypeEnum;
|
|
57
|
+
line: number;
|
|
58
|
+
col: number;
|
|
59
|
+
}[];
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* 解析error的stack,并返回args、column、line、func、url:
|
|
63
|
+
* @param ex
|
|
64
|
+
*/
|
|
65
|
+
export declare function extractErrorStack(ex: any): ReportDataType;
|
|
66
|
+
export declare class Queue {
|
|
67
|
+
private stack;
|
|
68
|
+
private isFlushing;
|
|
69
|
+
private micro;
|
|
70
|
+
constructor();
|
|
71
|
+
addFn(fn: (...arg: any) => any): void;
|
|
72
|
+
clear(): void;
|
|
73
|
+
getStack(): any[];
|
|
74
|
+
flushStack(): void;
|
|
75
|
+
}
|
|
76
|
+
export { GetDeviceInfo };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deppon/deppon-monitor-utils",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "ISC",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@deppon/deppon-monitor-shared": "2.2.
|
|
26
|
+
"@deppon/deppon-monitor-shared": "2.2.2",
|
|
27
27
|
"error-stack-parser": "^2.1.4",
|
|
28
28
|
"ua-parser-js": "^1.0.32"
|
|
29
29
|
},
|