1- import nodePath from "path" ;
21import projectDir from "./projectDir.cjs" ;
32
43let isWindows = / ^ w i n / . test ( globalThis . process ? globalThis . process . platform : undefined ) ,
@@ -37,7 +36,7 @@ export function resolve (from, to) {
3736 return pathname + search + hash ;
3837 }
3938 return resolvedUrl . toString ( ) ;
40- } ;
39+ }
4140
4241/**
4342 * Returns the current working directory (in Node) or the current page URL (in browsers).
@@ -58,7 +57,7 @@ export function cwd () {
5857 else {
5958 return path + "/" ;
6059 }
61- } ;
60+ }
6261
6362/**
6463 * Returns the protocol of the given URL, or `undefined` if it has no protocol.
@@ -71,7 +70,7 @@ export function getProtocol (path) {
7170 if ( match ) {
7271 return match [ 1 ] . toLowerCase ( ) ;
7372 }
74- } ;
73+ }
7574
7675/**
7776 * Returns the lowercased file extension of the given URL,
@@ -86,7 +85,7 @@ export function getExtension (path) {
8685 return stripQuery ( path . substr ( lastDot ) . toLowerCase ( ) ) ;
8786 }
8887 return "" ;
89- } ;
88+ }
9089
9190/**
9291 * Removes the query, if any, from the given path.
@@ -100,7 +99,7 @@ export function stripQuery (path) {
10099 path = path . substr ( 0 , queryIndex ) ;
101100 }
102101 return path ;
103- } ;
102+ }
104103
105104/**
106105 * Returns the hash (URL fragment), of the given path.
@@ -115,7 +114,7 @@ export function getHash (path) {
115114 return path . substr ( hashIndex ) ;
116115 }
117116 return "#" ;
118- } ;
117+ }
119118
120119/**
121120 * Removes the hash (URL fragment), if any, from the given path.
@@ -129,7 +128,7 @@ export function stripHash (path) {
129128 path = path . substr ( 0 , hashIndex ) ;
130129 }
131130 return path ;
132- } ;
131+ }
133132
134133/**
135134 * Determines whether the given path is an HTTP(S) URL.
@@ -150,7 +149,7 @@ export function isHttp (path) {
150149 // It's some other protocol, such as "ftp://", "mongodb://", etc.
151150 return false ;
152151 }
153- } ;
152+ }
154153
155154/**
156155 * Determines whether the given path is a filesystem path.
@@ -168,7 +167,7 @@ export function isFileSystemPath (path) {
168167
169168 let protocol = getProtocol ( path ) ;
170169 return protocol === undefined || protocol === "file" ;
171- } ;
170+ }
172171
173172/**
174173 * Converts a filesystem path to a properly-encoded URL.
@@ -211,7 +210,7 @@ export function fromFileSystemPath (path) {
211210 }
212211
213212 return path ;
214- } ;
213+ }
215214
216215/**
217216 * Converts a URL to a local filesystem path.
@@ -268,7 +267,7 @@ export function toFileSystemPath (path, keepFileProtocol) {
268267 }
269268
270269 return path ;
271- } ;
270+ }
272271
273272/**
274273 * Converts a $ref pointer to a valid JSON Path.
@@ -289,4 +288,4 @@ export function safePointerToPath (pointer) {
289288 . replace ( jsonPointerSlash , "/" )
290289 . replace ( jsonPointerTilde , "~" ) ;
291290 } ) ;
292- } ;
291+ }
0 commit comments