egg-http-parameter
Advanced tools
+8
-2
@@ -97,4 +97,10 @@ | ||
| conver:function(value,rule) { | ||
| if(!value || !value.trim()){ | ||
| return | ||
| } | ||
| const val = moment(value,rule.format || 'YYYY-MM-DD HH:mm:ss') | ||
| return rule.moment ? val : (val.isValid() ? val.toDate() : null) | ||
| if(!val.isValid()){ | ||
| return | ||
| } | ||
| return rule.moment ? val : val.toDate() | ||
| } | ||
@@ -125,3 +131,3 @@ } | ||
| conver:function(value,rule) { | ||
| return Number(value) | ||
| return parseInt(value,rule.radix) | ||
| } | ||
@@ -128,0 +134,0 @@ } |
+5
-6
| { | ||
| "name": "egg-http-parameter", | ||
| "version": "1.0.6", | ||
| "version": "1.0.7", | ||
| "description": "", | ||
@@ -14,3 +14,3 @@ "eggPlugin": { | ||
| "dependencies": { | ||
| "moment": "^2.18.1" | ||
| "moment": "^2.22.1" | ||
| }, | ||
@@ -42,7 +42,6 @@ "devDependencies": { | ||
| "files": [ | ||
| "app", | ||
| "config", | ||
| "app.js", | ||
| "agent.js", | ||
| "config", | ||
| "lib", | ||
| "app" | ||
| "lib" | ||
| ], | ||
@@ -49,0 +48,0 @@ "ci": { |
14974
0.28%267
2.3%Updated