not-node 6.2.9 → 6.2.10

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "not-node",
3
- "version": "6.2.9",
3
+ "version": "6.2.10",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,6 +1,7 @@
1
1
  /** @module Model/Validator */
2
2
  const validate = require("mongoose-validator");
3
3
  const { objHas, executeObjectFunction, isFunc, isAsync } = require("../common");
4
+ const notEnv = require("../env");
4
5
 
5
6
  function extractValidationEnvGetter(options) {
6
7
  if (
@@ -10,10 +11,15 @@ function extractValidationEnvGetter(options) {
10
11
  ) {
11
12
  return options.getValidationEnv;
12
13
  } else {
13
- //should return at least empty object
14
- return () => {
15
- return { validate };
16
- };
14
+ const globalGetValidationEnv = notEnv.getEnv("getValidationEnv");
15
+ if (globalGetValidationEnv && isFunc(globalGetValidationEnv)) {
16
+ return globalGetValidationEnv;
17
+ } else {
18
+ //should return at least empty object
19
+ return () => {
20
+ return { validate };
21
+ };
22
+ }
17
23
  }
18
24
  }
19
25