UNPKG
unpkg
Version:
latest (0.2.0)
0.2.0
0.1.0
0.0.1
The JavaScript API for unpkg
github.com/unpkg/unpkg
unpkg/unpkg
unpkg
/
modules
/
utils
/
isRemoteModuleIdentifier.js
11 lines
(8 loc)
•
281 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
const
URL
=
require
(
"whatwg-url"
)
function
isRemoteModuleIdentifier
(
id
) {
// Fully-qualified URL or URL w/out protocol
return
(
URL
.
parseURL
(id) !==
null
|| (id.
substr
(
0
,
2
) ===
"//"
&&
URL
.
parseURL
(
`http:
${id}
`
) !==
null
) ) }
module
.
exports
= isRemoteModuleIdentifier