@@ -678,4 +678,11 @@ 'use strict'; | ||
| const clone = Object.create(Object.getPrototypeOf(value)); | ||
| const proto = Object.getPrototypeOf(value); | ||
| const clone = Object.create(proto); | ||
| Object.assign(clone, value); | ||
| // Restore the prototype in case of pre-existing prototype pollution | ||
| if (Object.getPrototypeOf(clone) !== proto) { | ||
| Object.setPrototypeOf(clone, proto); | ||
| } | ||
| return clone; | ||
@@ -682,0 +689,0 @@ } |
+13
-1
@@ -696,3 +696,15 @@ 'use strict'; | ||
| res.pattern = rule.args.regex.source; | ||
| const pattern = rule.args.regex.source; | ||
| if (res.allOf) { | ||
| res.allOf.push({ pattern }); | ||
| } | ||
| else if (res.pattern !== undefined) { | ||
| res.allOf = [{ pattern: res.pattern }, { pattern }]; | ||
| delete res.pattern; | ||
| } | ||
| else { | ||
| res.pattern = pattern; | ||
| } | ||
| return res; | ||
@@ -699,0 +711,0 @@ }, |
+1
-1
| { | ||
| "name": "joi", | ||
| "description": "Object schema validation", | ||
| "version": "18.2.2", | ||
| "version": "18.2.3", | ||
| "repository": { | ||
@@ -6,0 +6,0 @@ "url": "git://github.com/hapijs/joi.git", |
Sorry, the diff of this file is too big to display
1890424
0.04%16857
0.09%