@@ -296,7 +296,6 @@ export class ConfigurationModel implements IConfigurationModel {
296
296
}
297
297
298
298
export interface ConfigurationParseOptions {
299
- skipUnregistered ?: boolean ;
300
299
scopes ?: ConfigurationScope [ ] ;
301
300
skipRestricted ?: boolean ;
302
301
include ?: string [ ] ;
@@ -429,10 +428,14 @@ export class ConfigurationModelParser {
429
428
restricted . push ( ...result . restricted ) ;
430
429
} else {
431
430
const propertySchema = configurationProperties [ key ] ;
431
+ const scope = propertySchema ? typeof propertySchema . scope !== 'undefined' ? propertySchema . scope : ConfigurationScope . WINDOW : undefined ;
432
432
if ( propertySchema ?. restricted ) {
433
433
restricted . push ( key ) ;
434
434
}
435
- if ( this . shouldInclude ( key , propertySchema , options ) ) {
435
+ if ( ! options . exclude ?. includes ( key ) /* Check exclude */
436
+ && ( options . include ?. includes ( key ) /* Check include */
437
+ || ( ( scope === undefined || options . scopes === undefined || options . scopes . includes ( scope ) ) /* Check scopes */
438
+ && ! ( options . skipRestricted && propertySchema ?. restricted ) ) ) ) /* Check restricted */ {
436
439
raw [ key ] = properties [ key ] ;
437
440
} else {
438
441
hasExcludedProperties = true ;
@@ -442,31 +445,6 @@ export class ConfigurationModelParser {
442
445
return { raw, restricted, hasExcludedProperties } ;
443
446
}
444
447
445
- private shouldInclude ( key : string , propertySchema : IConfigurationPropertySchema | undefined , options : ConfigurationParseOptions ) : boolean {
446
- if ( options . exclude ?. includes ( key ) ) {
447
- return false ;
448
- }
449
-
450
- if ( options . include ?. includes ( key ) ) {
451
- return true ;
452
- }
453
-
454
- if ( options . skipRestricted && propertySchema ?. restricted ) {
455
- return false ;
456
- }
457
-
458
- if ( options . skipUnregistered && ! propertySchema ) {
459
- return false ;
460
- }
461
-
462
- const scope = propertySchema ? typeof propertySchema . scope !== 'undefined' ? propertySchema . scope : ConfigurationScope . WINDOW : undefined ;
463
- if ( scope === undefined || options . scopes === undefined ) {
464
- return true ;
465
- }
466
-
467
- return options . scopes . includes ( scope ) ;
468
- }
469
-
470
448
private toOverrides ( raw : any , conflictReporter : ( message : string ) => void ) : IOverrides [ ] {
471
449
const overrides : IOverrides [ ] = [ ] ;
472
450
for ( const key of Object . keys ( raw ) ) {
0 commit comments