@domql/report 2.3.46 → 2.3.60
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/dist/cjs/index.js +87 -0
- package/dist/cjs/package.json +4 -0
- package/dist/esm/index.js +67 -0
- package/dist/iife/index.js +66 -0
- package/package.json +22 -4
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var report_exports = {};
|
|
20
|
+
__export(report_exports, {
|
|
21
|
+
ERRORS_REGISTRY: () => ERRORS_REGISTRY,
|
|
22
|
+
report: () => report
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(report_exports);
|
|
25
|
+
const ERRORS_REGISTRY = {
|
|
26
|
+
en: {
|
|
27
|
+
DocumentNotDefined: {
|
|
28
|
+
title: "Document is undefined",
|
|
29
|
+
description: "To tweak with DOM, you should use browser."
|
|
30
|
+
},
|
|
31
|
+
OverwriteToBuiltin: {
|
|
32
|
+
title: "Overwriting to builtin method",
|
|
33
|
+
description: "Overwriting a builtin method in the window define is not possible, please choose different name"
|
|
34
|
+
},
|
|
35
|
+
BrowserNotDefined: {
|
|
36
|
+
title: "Can't recognize environment",
|
|
37
|
+
description: "Environment should be browser application, that can run Javascript"
|
|
38
|
+
},
|
|
39
|
+
SetQuickPreferancesIsNotObject: {
|
|
40
|
+
title: "Quick preferances object is required",
|
|
41
|
+
description: 'Please pass a plain object with "lang", "culture" and "area" properties'
|
|
42
|
+
},
|
|
43
|
+
InvalidParams: {
|
|
44
|
+
title: "Params are invalid",
|
|
45
|
+
description: 'Please pass a plain object with "lang", "culture" and "area" properties'
|
|
46
|
+
},
|
|
47
|
+
CantCreateWithoutNode: {
|
|
48
|
+
title: "You must provide node",
|
|
49
|
+
description: "Can't create DOM element without setting node or text"
|
|
50
|
+
},
|
|
51
|
+
HTMLInvalidTag: {
|
|
52
|
+
title: "Element tag name (or DOM nodeName) is invalid",
|
|
53
|
+
description: "To create element, you must provide valid DOM node. See full list of them at here: http://www.w3schools.com/tags/"
|
|
54
|
+
},
|
|
55
|
+
HTMLInvalidAttr: {
|
|
56
|
+
title: "Attibutes object is invalid",
|
|
57
|
+
description: "Please pass a valid plain object to apply as an attributes for a DOM node"
|
|
58
|
+
},
|
|
59
|
+
HTMLInvalidData: {
|
|
60
|
+
title: "Data object is invalid",
|
|
61
|
+
description: "Please pass a valid plain object to apply as an dataset for a DOM node"
|
|
62
|
+
},
|
|
63
|
+
HTMLInvalidStyles: {
|
|
64
|
+
title: "Styles object is invalid",
|
|
65
|
+
description: "Please pass a valid plain object to apply as an style for a DOM node"
|
|
66
|
+
},
|
|
67
|
+
HTMLInvalidText: {
|
|
68
|
+
title: "Text string is invalid",
|
|
69
|
+
description: "Please pass a valid string to apply text to DOM node"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const report = (err, arg, element) => {
|
|
74
|
+
const currentLang = "en";
|
|
75
|
+
let errObj;
|
|
76
|
+
if (err && typeof err === "string")
|
|
77
|
+
errObj = ERRORS_REGISTRY[currentLang][err];
|
|
78
|
+
return new Error(
|
|
79
|
+
`"${err}", "${arg}"
|
|
80
|
+
|
|
81
|
+
`,
|
|
82
|
+
`${errObj.description}`,
|
|
83
|
+
element ? `
|
|
84
|
+
|
|
85
|
+
${element}` : ""
|
|
86
|
+
);
|
|
87
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const ERRORS_REGISTRY = {
|
|
2
|
+
en: {
|
|
3
|
+
DocumentNotDefined: {
|
|
4
|
+
title: "Document is undefined",
|
|
5
|
+
description: "To tweak with DOM, you should use browser."
|
|
6
|
+
},
|
|
7
|
+
OverwriteToBuiltin: {
|
|
8
|
+
title: "Overwriting to builtin method",
|
|
9
|
+
description: "Overwriting a builtin method in the window define is not possible, please choose different name"
|
|
10
|
+
},
|
|
11
|
+
BrowserNotDefined: {
|
|
12
|
+
title: "Can't recognize environment",
|
|
13
|
+
description: "Environment should be browser application, that can run Javascript"
|
|
14
|
+
},
|
|
15
|
+
SetQuickPreferancesIsNotObject: {
|
|
16
|
+
title: "Quick preferances object is required",
|
|
17
|
+
description: 'Please pass a plain object with "lang", "culture" and "area" properties'
|
|
18
|
+
},
|
|
19
|
+
InvalidParams: {
|
|
20
|
+
title: "Params are invalid",
|
|
21
|
+
description: 'Please pass a plain object with "lang", "culture" and "area" properties'
|
|
22
|
+
},
|
|
23
|
+
CantCreateWithoutNode: {
|
|
24
|
+
title: "You must provide node",
|
|
25
|
+
description: "Can't create DOM element without setting node or text"
|
|
26
|
+
},
|
|
27
|
+
HTMLInvalidTag: {
|
|
28
|
+
title: "Element tag name (or DOM nodeName) is invalid",
|
|
29
|
+
description: "To create element, you must provide valid DOM node. See full list of them at here: http://www.w3schools.com/tags/"
|
|
30
|
+
},
|
|
31
|
+
HTMLInvalidAttr: {
|
|
32
|
+
title: "Attibutes object is invalid",
|
|
33
|
+
description: "Please pass a valid plain object to apply as an attributes for a DOM node"
|
|
34
|
+
},
|
|
35
|
+
HTMLInvalidData: {
|
|
36
|
+
title: "Data object is invalid",
|
|
37
|
+
description: "Please pass a valid plain object to apply as an dataset for a DOM node"
|
|
38
|
+
},
|
|
39
|
+
HTMLInvalidStyles: {
|
|
40
|
+
title: "Styles object is invalid",
|
|
41
|
+
description: "Please pass a valid plain object to apply as an style for a DOM node"
|
|
42
|
+
},
|
|
43
|
+
HTMLInvalidText: {
|
|
44
|
+
title: "Text string is invalid",
|
|
45
|
+
description: "Please pass a valid string to apply text to DOM node"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const report = (err, arg, element) => {
|
|
50
|
+
const currentLang = "en";
|
|
51
|
+
let errObj;
|
|
52
|
+
if (err && typeof err === "string")
|
|
53
|
+
errObj = ERRORS_REGISTRY[currentLang][err];
|
|
54
|
+
return new Error(
|
|
55
|
+
`"${err}", "${arg}"
|
|
56
|
+
|
|
57
|
+
`,
|
|
58
|
+
`${errObj.description}`,
|
|
59
|
+
element ? `
|
|
60
|
+
|
|
61
|
+
${element}` : ""
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
ERRORS_REGISTRY,
|
|
66
|
+
report
|
|
67
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
(() => {
|
|
3
|
+
const ERRORS_REGISTRY = {
|
|
4
|
+
en: {
|
|
5
|
+
DocumentNotDefined: {
|
|
6
|
+
title: "Document is undefined",
|
|
7
|
+
description: "To tweak with DOM, you should use browser."
|
|
8
|
+
},
|
|
9
|
+
OverwriteToBuiltin: {
|
|
10
|
+
title: "Overwriting to builtin method",
|
|
11
|
+
description: "Overwriting a builtin method in the window define is not possible, please choose different name"
|
|
12
|
+
},
|
|
13
|
+
BrowserNotDefined: {
|
|
14
|
+
title: "Can't recognize environment",
|
|
15
|
+
description: "Environment should be browser application, that can run Javascript"
|
|
16
|
+
},
|
|
17
|
+
SetQuickPreferancesIsNotObject: {
|
|
18
|
+
title: "Quick preferances object is required",
|
|
19
|
+
description: 'Please pass a plain object with "lang", "culture" and "area" properties'
|
|
20
|
+
},
|
|
21
|
+
InvalidParams: {
|
|
22
|
+
title: "Params are invalid",
|
|
23
|
+
description: 'Please pass a plain object with "lang", "culture" and "area" properties'
|
|
24
|
+
},
|
|
25
|
+
CantCreateWithoutNode: {
|
|
26
|
+
title: "You must provide node",
|
|
27
|
+
description: "Can't create DOM element without setting node or text"
|
|
28
|
+
},
|
|
29
|
+
HTMLInvalidTag: {
|
|
30
|
+
title: "Element tag name (or DOM nodeName) is invalid",
|
|
31
|
+
description: "To create element, you must provide valid DOM node. See full list of them at here: http://www.w3schools.com/tags/"
|
|
32
|
+
},
|
|
33
|
+
HTMLInvalidAttr: {
|
|
34
|
+
title: "Attibutes object is invalid",
|
|
35
|
+
description: "Please pass a valid plain object to apply as an attributes for a DOM node"
|
|
36
|
+
},
|
|
37
|
+
HTMLInvalidData: {
|
|
38
|
+
title: "Data object is invalid",
|
|
39
|
+
description: "Please pass a valid plain object to apply as an dataset for a DOM node"
|
|
40
|
+
},
|
|
41
|
+
HTMLInvalidStyles: {
|
|
42
|
+
title: "Styles object is invalid",
|
|
43
|
+
description: "Please pass a valid plain object to apply as an style for a DOM node"
|
|
44
|
+
},
|
|
45
|
+
HTMLInvalidText: {
|
|
46
|
+
title: "Text string is invalid",
|
|
47
|
+
description: "Please pass a valid string to apply text to DOM node"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const report = (err, arg, element) => {
|
|
52
|
+
const currentLang = "en";
|
|
53
|
+
let errObj;
|
|
54
|
+
if (err && typeof err === "string")
|
|
55
|
+
errObj = ERRORS_REGISTRY[currentLang][err];
|
|
56
|
+
return new Error(
|
|
57
|
+
`"${err}", "${arg}"
|
|
58
|
+
|
|
59
|
+
`,
|
|
60
|
+
`${errObj.description}`,
|
|
61
|
+
element ? `
|
|
62
|
+
|
|
63
|
+
${element}` : ""
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
})();
|
package/package.json
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/report",
|
|
3
|
-
"version": "2.3.
|
|
4
|
-
"main": "index.js",
|
|
3
|
+
"version": "2.3.60",
|
|
5
4
|
"license": "MIT",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "dist/esm/index.js",
|
|
7
|
+
"unpkg": "dist/iife/index.js",
|
|
8
|
+
"jsdelivr": "dist/iife/index.js",
|
|
9
|
+
"main": "dist/esm/index.js",
|
|
10
|
+
"exports": "./dist/cjs/index.js",
|
|
11
|
+
"source": "index.js",
|
|
12
|
+
"files": [
|
|
13
|
+
"*.js",
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"copy:package:cjs": "cp ../../package-cjs.json dist/cjs/package.json",
|
|
18
|
+
"build:esm": "npx esbuild *.js --target=es2020 --format=esm --outdir=dist/esm",
|
|
19
|
+
"build:cjs": "npx esbuild *.js --target=node16 --format=cjs --outdir=dist/cjs && yarn copy:package:cjs",
|
|
20
|
+
"build:iife": "npx esbuild *.js --target=node16 --format=iife --outdir=dist/iife",
|
|
21
|
+
"build": "rimraf -I dist && yarn build:esm && yarn build:cjs && yarn build:iife",
|
|
22
|
+
"postinstall": "yarn build",
|
|
23
|
+
"prepublish": "yarn build"
|
|
24
|
+
},
|
|
25
|
+
"gitHead": "1c0635af260927e33f5e83507f1b126d23938fbc"
|
|
8
26
|
}
|