@@ -792,6 +792,163 @@ case-insensitive matching if set to true.
792792
793793The constructor can throw a ` TypeError ` to indicate parsing failure.
794794
795+ #### ` urlPattern.hash `
796+
797+ <!-- YAML
798+ added: v23.8.0
799+ -->
800+
801+ * Type: {string}
802+
803+ Gets the read-only pattern string of the URL pattern's ` hash ` component.
804+ In this example the pattern does not specify a hash component, so it matches
805+ any value and the pattern string is the wildcard ` '*' ` .
806+
807+ ``` js
808+ const myPattern = new URLPattern (' https://nodejs.org/docs/latest/api/*.html' );
809+ console .log (myPattern .hash );
810+ // Prints: *
811+ ```
812+
813+ #### ` urlPattern.hasRegExpGroups `
814+
815+ <!-- YAML
816+ added: v23.8.0
817+ -->
818+
819+ * Type: {boolean}
820+
821+ Gets a read-only boolean that is ` true ` if any component of the URL pattern
822+ contains a regular expression group, and ` false ` otherwise.
823+
824+ ``` js
825+ const bookPattern = new URLPattern ({ pathname: ' /books/:id' });
826+ console .log (bookPattern .hasRegExpGroups );
827+ // Prints: false
828+
829+ const versionPattern = new URLPattern ({ pathname: ' /docs/:version(v\\ d+)/*' });
830+ console .log (versionPattern .hasRegExpGroups );
831+ // Prints: true
832+ ```
833+
834+ #### ` urlPattern.hostname `
835+
836+ <!-- YAML
837+ added: v23.8.0
838+ -->
839+
840+ * Type: {string}
841+
842+ Gets the read-only pattern string of the URL pattern's ` hostname ` component.
843+
844+ ``` js
845+ const myPattern = new URLPattern (' https://nodejs.org/docs/latest/api/*.html' );
846+ console .log (myPattern .hostname );
847+ // Prints: nodejs.org
848+ ```
849+
850+ #### ` urlPattern.password `
851+
852+ <!-- YAML
853+ added: v23.8.0
854+ -->
855+
856+ * Type: {string}
857+
858+ Gets the read-only pattern string of the URL pattern's ` password ` component.
859+ In this example the pattern does not specify a password component, so it matches
860+ any value and the pattern string is the wildcard ` '*' ` .
861+
862+ ``` js
863+ const myPattern = new URLPattern (' https://nodejs.org/docs/latest/api/*.html' );
864+ console .log (myPattern .password );
865+ // Prints: *
866+ ```
867+
868+ #### ` urlPattern.pathname `
869+
870+ <!-- YAML
871+ added: v23.8.0
872+ -->
873+
874+ * Type: {string}
875+
876+ Gets the read-only pattern string of the URL pattern's ` pathname ` component.
877+
878+ ``` js
879+ const myPattern = new URLPattern (' https://nodejs.org/docs/latest/api/*.html' );
880+ console .log (myPattern .pathname );
881+ // Prints: /docs/latest/api/*.html
882+ ```
883+
884+ #### ` urlPattern.port `
885+
886+ <!-- YAML
887+ added: v23.8.0
888+ -->
889+
890+ * Type: {string}
891+
892+ Gets the read-only pattern string of the URL pattern's ` port ` component.
893+
894+ ``` js
895+ const myPattern = new URLPattern (' https://nodejs.org:8080/docs/*' );
896+ console .log (myPattern .port );
897+ // Prints: 8080
898+ ```
899+
900+ #### ` urlPattern.protocol `
901+
902+ <!-- YAML
903+ added: v23.8.0
904+ -->
905+
906+ * Type: {string}
907+
908+ Gets the read-only pattern string of the URL pattern's ` protocol ` component.
909+
910+ ``` js
911+ const myPattern = new URLPattern (' https://nodejs.org/docs/latest/api/*.html' );
912+ console .log (myPattern .protocol );
913+ // Prints: https
914+ ```
915+
916+ #### ` urlPattern.search `
917+
918+ <!-- YAML
919+ added: v23.8.0
920+ -->
921+
922+ * Type: {string}
923+
924+ Gets the read-only pattern string of the URL pattern's ` search ` component.
925+ In this example the pattern does not specify a search component, so it matches
926+ any value and the pattern string is the wildcard ` '*' ` .
927+
928+ ``` js
929+ const myPattern = new URLPattern (' https://nodejs.org/docs/latest/api/*.html' );
930+ console .log (myPattern .search );
931+ // Prints: *
932+ ```
933+
934+ #### ` urlPattern.username `
935+
936+ <!-- YAML
937+ added: v23.8.0
938+ -->
939+
940+ * Type: {string}
941+
942+ Gets the read-only pattern string of the URL pattern's ` username ` component.
943+ In this example the pattern does not specify a username component, so it matches
944+ any value and the pattern string is the wildcard ` '*' ` .
945+
946+ ``` js
947+ const myPattern = new URLPattern (' https://nodejs.org/docs/latest/api/*.html' );
948+ console .log (myPattern .username );
949+ // Prints: *
950+ ```
951+
795952#### ` urlPattern.exec(input[, baseURL]) `
796953
797954* ` input ` {string | Object} A URL or URL parts
0 commit comments