@@ -76,8 +76,8 @@ export function warnOptionHasBeenDeprecated(
76
76
let found = true
77
77
const nestedPropertyKeys = nestedPropertyKey . split ( '.' )
78
78
for ( const key of nestedPropertyKeys ) {
79
- if ( current [ key ] !== undefined ) {
80
- current = current [ key ]
79
+ if ( ( current as any ) [ key ] !== undefined ) {
80
+ current = ( current as any ) [ key ]
81
81
} else {
82
82
found = false
83
83
break
@@ -167,10 +167,12 @@ export function warnOptionHasBeenMovedOutOfExperimental(
167
167
const newKeys = newKey . split ( '.' )
168
168
while ( newKeys . length > 1 ) {
169
169
const key = newKeys . shift ( ) !
170
- current [ key ] = current [ key ] || { }
171
- current = current [ key ]
170
+ ; ( current as any ) [ key ] = ( current as any ) [ key ] || { }
171
+ current = ( current as any ) [ key ]
172
172
}
173
- current [ newKeys . shift ( ) ! ] = ( config . experimental as any ) [ oldExperimentalKey ]
173
+ ; ( current as any ) [ newKeys . shift ( ) ! ] = ( config . experimental as any ) [
174
+ oldExperimentalKey
175
+ ]
174
176
}
175
177
176
178
return config
@@ -192,7 +194,7 @@ function warnCustomizedOption(
192
194
if ( ! ( seg in current ) ) {
193
195
return
194
196
}
195
- current = current [ seg ]
197
+ current = ( current as any ) [ seg ]
196
198
}
197
199
198
200
if ( ! silent && current !== defaultValue ) {
@@ -218,16 +220,16 @@ function assignDefaultsAndValidate(
218
220
phase : PHASE_TYPE
219
221
) : NextConfigComplete {
220
222
const configFileName = userConfig . configFileName
221
- if ( typeof userConfig . exportTrailingSlash !== 'undefined' ) {
223
+ if ( typeof ( userConfig as any ) . exportTrailingSlash !== 'undefined' ) {
222
224
if ( ! silent ) {
223
225
Log . warn (
224
226
`The "exportTrailingSlash" option has been renamed to "trailingSlash". Please update your ${ configFileName } .`
225
227
)
226
228
}
227
229
if ( typeof userConfig . trailingSlash === 'undefined' ) {
228
- userConfig . trailingSlash = userConfig . exportTrailingSlash
230
+ userConfig . trailingSlash = ( userConfig as any ) . exportTrailingSlash
229
231
}
230
- delete userConfig . exportTrailingSlash
232
+ delete ( userConfig as any ) . exportTrailingSlash
231
233
}
232
234
233
235
// Handle migration of experimental.dynamicIO to experimental.cacheComponents
@@ -245,7 +247,7 @@ function assignDefaultsAndValidate(
245
247
246
248
const config = Object . keys ( userConfig ) . reduce < { [ key : string ] : any } > (
247
249
( currentConfig , key ) => {
248
- const value = userConfig [ key ]
250
+ const value = ( userConfig as any ) [ key ]
249
251
250
252
if ( value === undefined || value === null ) {
251
253
return currentConfig
@@ -1266,7 +1268,6 @@ function getCacheKey(
1266
1268
1267
1269
return djb2Hash ( keyData ) . toString ( 36 )
1268
1270
}
1269
-
1270
1271
export default async function loadConfig (
1271
1272
phase : PHASE_TYPE ,
1272
1273
dir : string ,
@@ -1371,7 +1372,7 @@ export default async function loadConfig(
1371
1372
silent ,
1372
1373
configuredExperimentalFeatures ,
1373
1374
phase
1374
- ) as NextConfigComplete ,
1375
+ ) ,
1375
1376
phase ,
1376
1377
silent
1377
1378
)
@@ -1481,7 +1482,7 @@ export default async function loadConfig(
1481
1482
validateConfigSchema ( userConfig , configFileName , curLog . warn )
1482
1483
}
1483
1484
1484
- if ( userConfig . target && userConfig . target !== 'server' ) {
1485
+ if ( ( userConfig as any ) . target && ( userConfig as any ) . target !== 'server' ) {
1485
1486
throw new Error (
1486
1487
`The "target" property is no longer supported in ${ configFileName } .\n` +
1487
1488
'See more info here https://nextjs.org/docs/messages/deprecated-target-config'
@@ -1538,7 +1539,7 @@ export default async function loadConfig(
1538
1539
silent ,
1539
1540
configuredExperimentalFeatures ,
1540
1541
phase
1541
- ) as NextConfigComplete
1542
+ )
1542
1543
1543
1544
const finalConfig = await applyModifyConfig ( completeConfig , phase , silent )
1544
1545
0 commit comments