File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change 354
354
355
355
// deleteUnknownProperties
356
356
if ( options . deleteUnknownProperties ) {
357
- props = schema . properties ? Object . keys ( schema . properties ) : [ ] ;
358
- props = props . concat ( schema . patternProperties ? Object . keys ( schema . patternProperties ) : [ ] ) ;
359
357
for ( p in object ) {
360
358
if ( object . hasOwnProperty ( p ) ) {
361
- if ( props . indexOf ( p ) === - 1 ) {
359
+ if ( visitedProps . indexOf ( p ) === - 1 ) {
362
360
delete object [ p ] ;
363
361
}
364
362
}
367
365
368
366
// unknownProperties
369
367
if ( options . unknownProperties ) {
370
- props = schema . properties ? Object . keys ( schema . properties ) : [ ] ;
371
- props = props . concat ( schema . patternProperties ? Object . keys ( schema . patternProperties ) : [ ] ) ;
372
368
for ( p in object ) {
373
369
if ( object . hasOwnProperty ( p ) ) {
374
- if ( props . indexOf ( p ) === - 1 ) {
370
+ if ( visitedProps . indexOf ( p ) === - 1 ) {
375
371
if ( options . unknownProperties === 'delete' ) {
376
372
delete object [ p ] ;
377
373
} else if ( options . unknownProperties === 'error' ) {
You can’t perform that action at this time.
0 commit comments