UNPKG
@netlify/redirect-parser
Version:
latest (15.0.3)
15.0.3
15.0.2
15.0.1
15.0.0
14.5.1
14.5.0
14.4.0
Parses netlify redirects into a js object representation
github.com/netlify/build
netlify/build
@netlify/redirect-parser
/
lib
/
url.js
6 lines
(5 loc)
•
197 B
JavaScript
View Raw
1
2
3
4
5
6
// Check if a field is valid redirect URL
export
const
isUrl =
function
(
pathOrUrl
) {
return
SCHEMES
.
some
(
(
scheme
) =>
pathOrUrl.
startsWith
(scheme)); };
const
SCHEMES
= [
'http://'
,
'https://'
];