🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

joi

Package Overview
Dependencies
Maintainers
6
Versions
249
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

joi - npm Package Compare versions

Comparing version
18.1.2
to
18.2.0
+21
-1
lib/types/link.js

@@ -55,6 +55,13 @@ 'use strict';

validate(value, { schema, state, prefs }) {
validate(value, { schema, state, prefs, error }) {
assert(schema.$_terms.link, 'Uninitialized link schema');
const limit = schema._flags.maxRecursion;
if (limit !== undefined &&
state.schemas.filter((entry) => entry.schema === schema).length > limit) {
return { value, errors: error('link.maxRecursion', { limit }) };
}
const linked = internals.generate(schema, value, state, prefs);

@@ -93,5 +100,18 @@ const ref = schema.$_terms.link[0].ref;

}
},
maxRecursion: {
method(limit) {
assert(Number.isSafeInteger(limit) && limit >= 1, 'limit must be a positive integer');
return this.$_setFlag('maxRecursion', limit);
}
}
},
messages: {
'link.maxRecursion': '{{#label}} exceeds maximum recursion depth of {{#limit}}'
},
overrides: {

@@ -98,0 +118,0 @@

+1
-1
{
"name": "joi",
"description": "Object schema validation",
"version": "18.1.2",
"version": "18.2.0",
"repository": {

@@ -6,0 +6,0 @@ "url": "git://github.com/hapijs/joi.git",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display