jet-schema
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -36,8 +36,8 @@ "use strict"; | ||
const retVal = []; | ||
for (const key of Object.keys(arg)) { | ||
if (!retVal.includes(key)) { | ||
retVal.push(key); | ||
return Object.keys(arg).reduce((arr, key) => { | ||
if (!arr.includes(key)) { | ||
arr.push(arg[key]); | ||
} | ||
} | ||
return retVal; | ||
return arr; | ||
}, []); | ||
} | ||
@@ -44,0 +44,0 @@ throw Error('"getEnumKeys" be an non-array object'); |
{ | ||
"name": "jet-schema", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Simple, typescript-first schema validation tool", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -20,3 +20,2 @@ # Jet-Schema ✈️ 📝 | ||
- Provides a `transform` wrapper function to modify values after before validating them. | ||
- When passing the `Date` constructor, automatically converts all valid date values to a `Date` object. | ||
- `new` and `test` functions provided automatically on every new `schema`. | ||
@@ -180,2 +179,7 @@ - Works client-side or server-side. | ||
console.log(FullSchema.new()); | ||
``` | ||
``` | ||
### Misc | ||
- When passing the `Date` constructor, automatically converts all valid date values to a `Date` object. | ||
- You can also use an enum as a validator. The default value will be the first value in the enum object. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44933
184