Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
f66be228
Unverified
Commit
f66be228
authored
May 19, 2020
by
Maxi Gimenez
Committed by
GitHub
May 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(next): check-custom-routes - recursive-copy missing types (#13065)
parent
dc826e3d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
check-custom-routes.ts
packages/next/lib/check-custom-routes.ts
+5
-3
recursive-copy.ts
packages/next/lib/recursive-copy.ts
+1
-1
No files found.
packages/next/lib/check-custom-routes.ts
View file @
f66be228
...
@@ -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
))
{
...
...
packages/next/lib/recursive-copy.ts
View file @
f66be228
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment