Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support for numeric separators in revalidate config (#51438)
### Fixing a bug - [x] Related issues linked using `fixes #number` - [x] Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - [ ] Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### What? Currently, when the check on validating the type of `revalidate` is run, we use the `Number` function to parse the value of `revalidate`, however the `Number` function takes a [`StringNumericLiteral`](https://tc39.es/ecma262/2023/#prod-StringNumericLiteral) which doesn't allow the usage of the `_` separator to format your numbers. This PR allows you to add numeric separators in the `revalidate` export. ### Why? When configuring the actual code, we should be allowed to use numeric separators as it is a syntax that is supported by most runtimes. ### How? A simple `replaceAll` call that removes all `_`s between digits. Closes NEXT-1122 Fixes #49485 --------- Co-authored-by: JJ Kasper <jj@jjsweb.site>
- Loading branch information