File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -224,7 +224,23 @@ import * as url from "node:url";
224224}
225225
226226{
227- const urlPattern = new url . URLPattern ( "https://nodejs.org/docs/latest/api/*.html" ) ;
227+ const urlPattern = new url . URLPattern ( "https://nodejs.org/docs/latest/api/*.html" , { ignoreCase : false } ) ;
228228 urlPattern . exec ( "https://nodejs.org/docs/latest/api/dns.html" ) ;
229229 urlPattern . test ( "https://nodejs.org/docs/latest/api/dns.html" ) ;
230230}
231+
232+ {
233+ const init : url . URLPatternInit = {
234+ pathname : "../docs/latest/api/*.html" ,
235+ } ;
236+
237+ const urlPattern = new url . URLPattern ( init ) ;
238+ urlPattern . exec ( init , "https://nodejs.org/about" ) ;
239+ urlPattern . test ( init , "https://nodejs.org/about" ) ;
240+ }
241+
242+ {
243+ const urlPattern = new url . URLPattern ( { } ) ;
244+ urlPattern . exec ( ) ;
245+ urlPattern . test ( ) ;
246+ }
Original file line number Diff line number Diff line change @@ -791,8 +791,17 @@ declare module "url" {
791791 class URLPattern {
792792 constructor ( input : string | URLPatternInit , baseURL : string , options ?: URLPatternOptions ) ;
793793 constructor ( input ?: string | URLPatternInit , options ?: URLPatternOptions ) ;
794- exec ( input : string | URLPatternInit , baseURL ?: string ) : URLPatternResult | null ;
795- test ( input : string | URLPatternInit , baseURL ?: string ) : boolean ;
794+ exec ( input ?: string | URLPatternInit , baseURL ?: string ) : URLPatternResult | null ;
795+ readonly hasRegExpGroups : boolean ;
796+ readonly hash : string ;
797+ readonly hostname : string ;
798+ readonly password : string ;
799+ readonly pathname : string ;
800+ readonly port : string ;
801+ readonly protocol : string ;
802+ readonly search : string ;
803+ test ( input ?: string | URLPatternInit , baseURL ?: string ) : boolean ;
804+ readonly username : string ;
796805 }
797806 interface URLSearchParamsIterator < T > extends NodeJS . Iterator < T , NodeJS . BuiltinIteratorReturn , unknown > {
798807 [ Symbol . iterator ] ( ) : URLSearchParamsIterator < T > ;
You can’t perform that action at this time.
0 commit comments