@@ -43,16 +43,16 @@ export interface HasProtocolOptions {
43
43
*/
44
44
export function hasProtocol (
45
45
inputString : string ,
46
- opts ?: HasProtocolOptions
46
+ opts ?: HasProtocolOptions ,
47
47
) : boolean ;
48
48
/** @deprecated Same as { hasProtocol(inputString, { acceptRelative: true }) */
49
49
export function hasProtocol (
50
50
inputString : string ,
51
- acceptRelative : boolean
51
+ acceptRelative : boolean ,
52
52
) : boolean ;
53
53
export function hasProtocol (
54
54
inputString : string ,
55
- opts : boolean | HasProtocolOptions = { }
55
+ opts : boolean | HasProtocolOptions = { } ,
56
56
) : boolean {
57
57
if ( typeof opts === "boolean" ) {
58
58
opts = { acceptRelative : opts } ;
@@ -82,7 +82,7 @@ export function isScriptProtocol(protocol?: string) {
82
82
*/
83
83
export function hasTrailingSlash (
84
84
input = "" ,
85
- respectQueryAndFragment ?: boolean
85
+ respectQueryAndFragment ?: boolean ,
86
86
) : boolean {
87
87
if ( ! respectQueryAndFragment ) {
88
88
return input . endsWith ( "/" ) ;
@@ -107,7 +107,7 @@ export function hasTrailingSlash(
107
107
*/
108
108
export function withoutTrailingSlash (
109
109
input = "" ,
110
- respectQueryAndFragment ?: boolean
110
+ respectQueryAndFragment ?: boolean ,
111
111
) : string {
112
112
if ( ! respectQueryAndFragment ) {
113
113
return ( hasTrailingSlash ( input ) ? input . slice ( 0 , - 1 ) : input ) || "/" ;
@@ -146,7 +146,7 @@ export function withoutTrailingSlash(
146
146
*/
147
147
export function withTrailingSlash (
148
148
input = "" ,
149
- respectQueryAndFragment ?: boolean
149
+ respectQueryAndFragment ?: boolean ,
150
150
) : string {
151
151
if ( ! respectQueryAndFragment ) {
152
152
return input . endsWith ( "/" ) ? input : input + "/" ;
@@ -283,7 +283,7 @@ export function withQuery(input: string, query: QueryObject): string {
283
283
* @group utils
284
284
*/
285
285
export function getQuery < T extends ParsedQuery = ParsedQuery > (
286
- input : string
286
+ input : string ,
287
287
) : T {
288
288
return parseQuery < T > ( parseURL ( input ) . search ) ;
289
289
}
@@ -506,7 +506,7 @@ export function normalizeURL(input: string): string {
506
506
export function resolveURL ( base = "" , ...inputs : string [ ] ) : string {
507
507
if ( typeof base !== "string" ) {
508
508
throw new TypeError (
509
- `URL input should be string received ${ typeof base } (${ base } )`
509
+ `URL input should be string received ${ typeof base } (${ base } )` ,
510
510
) ;
511
511
}
512
512
0 commit comments