@nsshunt/stsutils 1.6.2 → 1.7.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/package.json +6 -6
- package/stsoptionsbase.js +10 -7
- package/validate.js +3 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nsshunt/stsutils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
"parser": "@babel/eslint-parser"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@babel/core": "^7.17.
|
|
25
|
+
"@babel/core": "^7.17.5",
|
|
26
26
|
"@babel/eslint-parser": "^7.17.0",
|
|
27
27
|
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
|
28
28
|
"@babel/plugin-proposal-private-methods": "^7.16.11",
|
|
29
|
-
"eslint": "^8.
|
|
30
|
-
"jest": "^27.
|
|
29
|
+
"eslint": "^8.9.0",
|
|
30
|
+
"jest": "^27.5.1"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"ajv": "^8.
|
|
34
|
-
"axios": "^0.
|
|
33
|
+
"ajv": "^8.10.0",
|
|
34
|
+
"axios": "^0.26.0",
|
|
35
35
|
"colors": "^1.4.0",
|
|
36
36
|
"debug": "^4.3.3"
|
|
37
37
|
}
|
package/stsoptionsbase.js
CHANGED
|
@@ -4,15 +4,17 @@ class STSOptionsBase
|
|
|
4
4
|
{
|
|
5
5
|
#options = null;
|
|
6
6
|
|
|
7
|
-
constructor(options = null
|
|
7
|
+
constructor(options = null)
|
|
8
8
|
{
|
|
9
9
|
this.#options = options;
|
|
10
10
|
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
if (options !== null) {
|
|
12
|
+
if (typeof options.validator === 'undefined') {
|
|
13
|
+
console.log(JSON.stringify(options));
|
|
14
|
+
console.trace("Options Here ------------------------------------------------------------------------------------------")
|
|
15
|
+
} else {
|
|
16
|
+
Validate(options.validator, options);
|
|
17
|
+
}
|
|
16
18
|
}
|
|
17
19
|
}
|
|
18
20
|
|
|
@@ -21,7 +23,8 @@ class STSOptionsBase
|
|
|
21
23
|
*/
|
|
22
24
|
get Options()
|
|
23
25
|
{
|
|
24
|
-
|
|
26
|
+
console.trace("Use of Options Here <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<----------------------------------------")
|
|
27
|
+
return this.#options;
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
get options()
|
package/validate.js
CHANGED
|
@@ -7,6 +7,8 @@ const _Validate = (validator, payload) => {
|
|
|
7
7
|
if (!valid) {
|
|
8
8
|
console.error(validator.errors);
|
|
9
9
|
console.trace('Invalid Schema');
|
|
10
|
+
console.log('Payload:-');
|
|
11
|
+
console.log(JSON.stringify(payload));
|
|
10
12
|
process.exit(1);
|
|
11
13
|
}
|
|
12
14
|
};
|
|
@@ -24,7 +26,4 @@ const Validate = (name, payload) => {
|
|
|
24
26
|
_Validate(validator, payload);
|
|
25
27
|
};
|
|
26
28
|
|
|
27
|
-
module.exports = {
|
|
28
|
-
AddSchema,
|
|
29
|
-
Validate
|
|
30
|
-
};
|
|
29
|
+
module.exports = { AddSchema, Validate };
|