Skip to content

Commit e26bf04

Browse files
authored
add forbiddenKeys method to object
This will allow very interesting modular systems where you can define a global very generic object. Then each module can add their own restrictions using that base object, allowing, disallowing or making required certain properties. Combine this with some default values and you will have a very strong and modular system with high consistency on the results.
1 parent 257e65e commit e26bf04

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/object.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,12 @@ internals.Object = class extends Any {
503503
children = Hoek.flatten(Array.prototype.slice.call(arguments));
504504
return this.applyFunctionToChildren(children, 'optional');
505505
}
506+
507+
forbiddenKeys(children) {
508+
509+
children = Hoek.flatten(Array.prototype.slice.call(arguments));
510+
return this.applyFunctionToChildren(children, 'forbidden');
511+
}
506512

507513
rename(from, to, options) {
508514

0 commit comments

Comments
 (0)