@nsshunt/stsutils 1.7.2 → 1.7.6
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/.github/dependabot.yml +1 -8
- package/package.json +5 -5
- package/validate.js +7 -2
package/.github/dependabot.yml
CHANGED
|
@@ -10,11 +10,4 @@ updates:
|
|
|
10
10
|
- package-ecosystem: "npm" # See documentation for possible values
|
|
11
11
|
directory: "/" # Location of package manifests
|
|
12
12
|
schedule:
|
|
13
|
-
interval: "
|
|
14
|
-
|
|
15
|
-
- package-ecosystem: "github-actions"
|
|
16
|
-
# Workflow files stored in the
|
|
17
|
-
# default location of `.github/workflows`
|
|
18
|
-
directory: "/"
|
|
19
|
-
schedule:
|
|
20
|
-
interval: "weekly"
|
|
13
|
+
interval: "monthly"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nsshunt/stsutils",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
"parser": "@babel/eslint-parser"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@babel/core": "^7.17.
|
|
25
|
+
"@babel/core": "^7.17.8",
|
|
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.
|
|
29
|
+
"eslint": "^8.11.0",
|
|
30
30
|
"jest": "^27.5.1"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"ajv": "^8.10.0",
|
|
34
|
-
"axios": "^0.26.
|
|
34
|
+
"axios": "^0.26.1",
|
|
35
35
|
"colors": "^1.4.0",
|
|
36
|
-
"debug": "^4.3.
|
|
36
|
+
"debug": "^4.3.4"
|
|
37
37
|
}
|
|
38
38
|
}
|
package/validate.js
CHANGED
|
@@ -5,12 +5,17 @@ const ajv = new Ajv();
|
|
|
5
5
|
const _Validate = (validator, payload) => {
|
|
6
6
|
const valid = validator(payload);
|
|
7
7
|
if (!valid) {
|
|
8
|
+
return validator.errors;
|
|
9
|
+
} else {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
/*
|
|
8
13
|
console.error(validator.errors);
|
|
9
14
|
console.trace('Invalid Schema');
|
|
10
15
|
console.log('Payload:-');
|
|
11
16
|
console.log(JSON.stringify(payload));
|
|
12
17
|
process.exit(1);
|
|
13
|
-
|
|
18
|
+
*/
|
|
14
19
|
};
|
|
15
20
|
|
|
16
21
|
const AddSchema = (name, schema) => {
|
|
@@ -23,7 +28,7 @@ const AddSchema = (name, schema) => {
|
|
|
23
28
|
|
|
24
29
|
const Validate = (name, payload) => {
|
|
25
30
|
const validator = ajv.getSchema(name)
|
|
26
|
-
_Validate(validator, payload);
|
|
31
|
+
return _Validate(validator, payload);
|
|
27
32
|
};
|
|
28
33
|
|
|
29
34
|
module.exports = { AddSchema, Validate };
|