@@ -169,7 +169,7 @@ export default class Client<T extends Config = Config> {
169169 }
170170
171171 _configure ( opts : T , internalPlugins : Plugin < T > [ ] ) {
172- const schema = internalPlugins . reduce ( ( schema , plugin ) => {
172+ const schema : Record < string , any > = internalPlugins . reduce ( ( schema , plugin ) => {
173173 if ( plugin && plugin . configSchema ) return Object . assign ( { } , schema , plugin . configSchema )
174174 return schema
175175 } , this . _schema )
@@ -181,15 +181,15 @@ export default class Client<T extends Config = Config> {
181181
182182 // accumulate configuration and error messages
183183 const { errors, config } = ( Object . keys ( schema ) as ( keyof T ) [ ] ) . reduce ( ( accum : { errors : Record < any , any > , config : Record < any , any > } , key : keyof typeof opts ) => {
184- const defaultValue = schema [ key ] . defaultValue ( opts [ key ] )
184+ const defaultValue = schema [ key as string ] . defaultValue ( opts [ key ] )
185185
186186 if ( opts [ key ] !== undefined ) {
187- const valid = schema [ key ] . validate ( opts [ key ] )
187+ const valid = schema [ key as string ] . validate ( opts [ key ] )
188188 if ( ! valid ) {
189- accum . errors [ key ] = schema [ key ] . message
189+ accum . errors [ key ] = schema [ key as string ] . message
190190 accum . config [ key ] = defaultValue
191191 } else {
192- if ( schema [ key ] . allowPartialObject ) {
192+ if ( schema [ key as string ] . allowPartialObject ) {
193193 accum . config [ key ] = Object . assign ( defaultValue , opts [ key ] )
194194 } else {
195195 accum . config [ key ] = opts [ key ]
0 commit comments