UNPKG
fliphub-monorepo
Version:
latest (0.1.3)
0.1.3
0.1.2
the builder of builders
github.com/fliphub/fliphub
fliphub/fliphub
fliphub-monorepo
/
modules
/
flipfile
/
isRel.js
9 lines
(8 loc)
•
271 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
// @
TODO:
could trim too
module
.
exports
=
function
isRel
(
url
) {
if
(!url || !url.
slice
)
return
false
return
(
/^(\.){1,2}(\/){1,2}$/
.
test
(url.
slice
(
0
,
3
)) ||
/(\/){1,2}(\.){1,2}(\/){1,2}/
.
test
(url)) || url.
indexOf
(
'./'
) ===
0
|| url.
indexOf
(
'../'
) ===
0
}