UNPKG
path2
Version:
latest (0.1.0)
0.1.0
Modular and extended version of `path` package
github.com/medikoo/path2
medikoo/path2
path2
/
windows
/
is-absolute.js
12 lines
(8 loc)
•
293 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
'use strict'
;
var
splitDeviceRe =
require
(
'./_split-device-re'
);
module
.
exports
=
function
(
path
) {
var
result = splitDeviceRe.
exec
(path), device = result[
1
] ||
''
, isUnc = device && device.
charAt
(
1
) !==
':'
;
// UNC paths are always absolute
return
!!result[
2
] || isUnc ||
false
; };