Unverified Commit f66be228 authored by Maxi Gimenez's avatar Maxi Gimenez Committed by GitHub

chore(next): check-custom-routes - recursive-copy missing types (#13065)

parent dc826e3d
...@@ -22,14 +22,16 @@ export type Header = { ...@@ -22,14 +22,16 @@ export type Header = {
const allowedStatusCodes = new Set([301, 302, 303, 307, 308]) const allowedStatusCodes = new Set([301, 302, 303, 307, 308])
export function getRedirectStatus(route: Redirect) { export function getRedirectStatus(route: Redirect): number {
return ( return (
route.statusCode || route.statusCode ||
(route.permanent ? PERMANENT_REDIRECT_STATUS : TEMPORARY_REDIRECT_STATUS) (route.permanent ? PERMANENT_REDIRECT_STATUS : TEMPORARY_REDIRECT_STATUS)
) )
} }
function checkRedirect(route: Redirect) { function checkRedirect(
route: Redirect
): { invalidParts: string[]; hadInvalidStatus: boolean } {
const invalidParts: string[] = [] const invalidParts: string[] = []
let hadInvalidStatus: boolean = false let hadInvalidStatus: boolean = false
...@@ -47,7 +49,7 @@ function checkRedirect(route: Redirect) { ...@@ -47,7 +49,7 @@ function checkRedirect(route: Redirect) {
} }
} }
function checkHeader(route: Header) { function checkHeader(route: Header): string[] {
const invalidParts: string[] = [] const invalidParts: string[] = []
if (!Array.isArray(route.headers)) { if (!Array.isArray(route.headers)) {
......
...@@ -16,7 +16,7 @@ export async function recursiveCopy( ...@@ -16,7 +16,7 @@ export async function recursiveCopy(
overwrite?: boolean overwrite?: boolean
filter?(path: string): boolean filter?(path: string): boolean
} = {} } = {}
) { ): Promise<void> {
const cwdPath = process.cwd() const cwdPath = process.cwd()
const from = path.resolve(cwdPath, source) const from = path.resolve(cwdPath, source)
const to = path.resolve(cwdPath, dest) const to = path.resolve(cwdPath, dest)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment