@orion-js/schema
Advanced tools
Comparing version 3.3.12 to 3.3.13
@@ -15,3 +15,3 @@ "use strict"; | ||
...(0, fieldType_1.default)({ | ||
name: 'enum', | ||
name: 'custom', | ||
meta: { | ||
@@ -18,0 +18,0 @@ enumName: name, |
@@ -27,2 +27,4 @@ "use strict"; | ||
return 'boolean'; | ||
if (type === 'enum') | ||
return 'string'; | ||
if (!(0, isString_1.default)(type)) { | ||
@@ -29,0 +31,0 @@ throw new Error('Field type is invalid. Pass a string or a custom field type. Got ' + type); |
@@ -9,2 +9,3 @@ "use strict"; | ||
const getFieldType_1 = __importDefault(require("./getFieldType")); | ||
const __1 = require("../.."); | ||
test('returns object validator when an object is passed', async () => { | ||
@@ -63,1 +64,11 @@ const validator = (0, getFieldValidator_1.default)({ name: { type: String } }); | ||
}); | ||
test('passes when field type is custom (for client side)', async () => { | ||
const schema = { | ||
name: { | ||
type: 'enum' | ||
} | ||
}; | ||
await (0, __1.clean)(schema, { name: 'test' }); | ||
await (0, __1.validate)(schema, { name: 'test' }); | ||
(0, getFieldValidator_1.default)('enum'); | ||
}); |
{ | ||
"name": "@orion-js/schema", | ||
"version": "3.3.12", | ||
"version": "3.3.13", | ||
"main": "lib/index.js", | ||
@@ -34,3 +34,3 @@ "types": "lib/index.d.ts", | ||
}, | ||
"gitHead": "c8014109e337dc98256ebfe0f0c2739746bd9eaf" | ||
"gitHead": "8b63161dd4c14fa182571eb46a7fb87a67895a07" | ||
} |
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
111542
3088