request-guardian 1.0.14 → 1.0.15

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.
Files changed (2) hide show
  1. package/index.js +8 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -24,8 +24,14 @@ function runValidator(validations) {
24
24
  };
25
25
  }
26
26
  function validate(app) {
27
- for (const key in require(path.resolve('utils/validations/index')) ) {
28
- app.use(key, runValidator(require(path.resolve('utils/validations/index'))[key]));
27
+ try {
28
+ for (const key in require(path.resolve('utils/validations/index'))) {
29
+ app.use(key, runValidator(require(path.resolve('utils/validations/index'))[key]));
30
+ }
31
+ } catch (error) {
32
+ if (error.code === 'MODULE_NOT_FOUND') {
33
+ console.log(`Validations rules not found at utils/validations/index.js`)
34
+ }
29
35
  }
30
36
  }
31
37
  module.exports = validate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "request-guardian",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {