not-node 5.0.6 → 5.0.7
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/bin/not-builder.js +3 -3
- package/package.json +1 -1
- package/src/model/buildValidator.js +10 -4
package/bin/not-builder.js
CHANGED
|
@@ -503,8 +503,8 @@ async function build_Server(pathToRoot, roles, targetName, targetManifest){
|
|
|
503
503
|
let indexFile = path.join(pathToRoot, targetManifest.src, 'index.' + role + '.js');
|
|
504
504
|
let rollupFile = path.join(pathToRoot, targetManifest.root, 'rollup.' + role + '.js');
|
|
505
505
|
let bundleFile = path.join(pathToRoot, targetManifest.build, role + '.js');
|
|
506
|
-
let templateFile = path.join(pathToRoot, targetManifest.build, role + '.html');
|
|
507
|
-
await lib.renderScript(path.join(pathToRoot,targetManifest.index), {
|
|
506
|
+
//let templateFile = path.join(pathToRoot, targetManifest.build, role + '.html');
|
|
507
|
+
await lib.renderScript(path.join(pathToRoot, targetManifest.index), {
|
|
508
508
|
mods:list[role].controllers,
|
|
509
509
|
scss: list[role].styles,
|
|
510
510
|
env: opts.environment,
|
|
@@ -522,7 +522,7 @@ async function build_Server(pathToRoot, roles, targetName, targetManifest){
|
|
|
522
522
|
NODE_ENV: opts.environment
|
|
523
523
|
}
|
|
524
524
|
});
|
|
525
|
-
await lib.joinToFile(templateFile, list[role].templates);
|
|
525
|
+
//await lib.joinToFile(templateFile, list[role].templates);
|
|
526
526
|
}catch(e){
|
|
527
527
|
console.error(e);
|
|
528
528
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @module Model/Validator */
|
|
2
2
|
const validate = require('mongoose-validator');
|
|
3
|
-
const {objHas, executeObjectFunction, isFunc} = require('../common');
|
|
3
|
+
const {objHas, executeObjectFunction, isFunc, isAsync} = require('../common');
|
|
4
4
|
|
|
5
5
|
function extractValidationEnvGetter(options){
|
|
6
6
|
if(options && objHas(options, 'getValidationEnv') && isFunc(options.getValidationEnv)){
|
|
@@ -23,9 +23,15 @@ function extendModern(rule, options){
|
|
|
23
23
|
const result = {...rule};
|
|
24
24
|
delete result.validator;
|
|
25
25
|
const validationEnv = extractValidationEnvGetter(options)();
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
if(isAsync(rule.validator)){
|
|
27
|
+
result.validator = async (val) => {
|
|
28
|
+
return await executeObjectFunction(rule, 'validator', [val, validationEnv]);
|
|
29
|
+
};
|
|
30
|
+
}else{
|
|
31
|
+
result.validator = (val) => {
|
|
32
|
+
return executeObjectFunction(rule, 'validator', [val, validationEnv]);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
29
35
|
return result;
|
|
30
36
|
}
|
|
31
37
|
|