Socket
Socket
Sign inDemoInstall

@orion-js/schema

Package Overview
Dependencies
Maintainers
3
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orion-js/schema - npm Package Compare versions

Comparing version 3.3.12 to 3.3.13

2

lib/fieldTypes/enum.js

@@ -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"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc