@aeriajs/validation 0.0.156 → 0.0.157

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/dist/validate.js CHANGED
@@ -97,6 +97,9 @@ const validateProperty = (what, property, options = {}) => {
97
97
  if (expectedType === 'string' && typeof what === 'number') {
98
98
  return types_1.Result.result(String(what));
99
99
  }
100
+ if (expectedType === 'datetime' && typeof what === 'string') {
101
+ return types_1.Result.result(new Date(what));
102
+ }
100
103
  }
101
104
  return types_1.Result.error(makePropertyError(types_1.PropertyValidationErrorCode.Unmatching, {
102
105
  expected: expectedType,
package/dist/validate.mjs CHANGED
@@ -89,6 +89,9 @@ export const validateProperty = (what, property, options = {}) => {
89
89
  if (expectedType === "string" && typeof what === "number") {
90
90
  return Result.result(String(what));
91
91
  }
92
+ if (expectedType === "datetime" && typeof what === "string") {
93
+ return Result.result(new Date(what));
94
+ }
92
95
  }
93
96
  return Result.error(makePropertyError(PropertyValidationErrorCode.Unmatching, {
94
97
  expected: expectedType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/validation",
3
- "version": "0.0.156",
3
+ "version": "0.0.157",
4
4
  "description": "## Installation",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -27,9 +27,9 @@
27
27
  "@aeriajs/types": "link:../types"
28
28
  },
29
29
  "peerDependencies": {
30
- "@aeriajs/common": "^0.0.140",
31
- "@aeriajs/entrypoint": "^0.0.144",
32
- "@aeriajs/types": "^0.0.122",
30
+ "@aeriajs/common": "^0.0.141",
31
+ "@aeriajs/entrypoint": "^0.0.145",
32
+ "@aeriajs/types": "^0.0.123",
33
33
  "mongodb": "^6.5.0"
34
34
  },
35
35
  "scripts": {