@@ -98,17 +98,6 @@ const DEFAULT_SETUP_CONFIG_SCHEMA = {
9898 ) ,
9999} as const satisfies json . Schema ;
100100
101- /**
102- * Checks `config` against the properties that Default Setup sets in the `config` input. The result
103- * lists any other properties in `unknownKeys`, and any properties with invalid values in
104- * `invalidKeys`.
105- */
106- function checkDefaultSetupConfig (
107- config : json . UnvalidatedObject < any > ,
108- ) : json . CheckSchemaResult {
109- return json . checkSchema ( DEFAULT_SETUP_CONFIG_SCHEMA , config ) ;
110- }
111-
112101/**
113102 * Returns whether `config` is a mapping that only sets the properties that Default Setup sets in
114103 * the `config` input, to valid values.
@@ -118,7 +107,10 @@ export function matchesDefaultSetupConfigSchema(config: UserConfig): boolean {
118107 if ( ! json . isObject ( config ) ) {
119108 return false ;
120109 }
121- const result = checkDefaultSetupConfig ( config as json . UnvalidatedObject < any > ) ;
110+ const result = json . checkSchema (
111+ DEFAULT_SETUP_CONFIG_SCHEMA ,
112+ config as json . UnvalidatedObject < any > ,
113+ ) ;
122114 // `valid` doesn't account for unknown properties.
123115 return result . valid && result . unknownKeys . length === 0 ;
124116}
@@ -145,7 +137,8 @@ export function mergeDefaultSetupAndUserConfigs(
145137 // Check for unexpected keys in the configuration from the `config` input
146138 // that was provided by Default Setup. This should only contain the keys
147139 // we would expect to receive from Default Setup.
148- const schemaCheckResult = checkDefaultSetupConfig (
140+ const schemaCheckResult = json . checkSchema (
141+ DEFAULT_SETUP_CONFIG_SCHEMA ,
149142 fromConfigInput as json . UnvalidatedObject < any > ,
150143 ) ;
151144
0 commit comments