next.js
53fd5ac0 - fix(ts): match `MiddlewareConfig` with documentation (#61718)

Commit
1 year ago
fix(ts): match `MiddlewareConfig` with documentation (#61718) ### What? Fix the user-facing `MiddlewareConfig` interface. ~While in the codebase, I also made the incoming config object type a bit more strict by converting from `any` to `unknown`.~ Reverted, as we do a config assertion already in a [different place](https://github.com/vercel/next.js/blob/canary/packages/next-swc/crates/next-custom-transforms/src/transforms/page_config.rs/#L171-L180). ### Why? The interface we previously exposed was the one we used internally, _after_ we did some parsing on the config object, which is different from what the user is expected to pass. ### How? I separated the internal type to its own `MiddlewareConfigParsed` interface. Closes NEXT-2375 Fixes #61705 Ref: #61576
Author
Parents
Loading