Skip to content

Commit

Permalink
rfc compliant url
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy-zhening-luo committed Jan 23, 2025
1 parent 6cbbc4d commit 17eb04c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/object/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function (
path = "",
query = "",
fragment = "",
} = (/^(?:(?<scheme>[^:/?#]+):)?(?:\/\/(?<host>[^/?#]*))?(?<path>[^?#]*)(?:\?(?<query>[^#]*))?(?:#(?<fragment>.*))?/u)
} = (/^(?<scheme>\pL[-+\.\pL\d]+):\/\/(?<host>(?:(?:[-~!$&'()*+,;=\.\w]|(?:%[a-fA-F\d]{2}))*(?::\d+)?))(?<path>(?:\/(?:(?:[-~!$&'()*+,;=\.\w]|(?:%[a-fA-F\d]{2}))|[:@])*)*)(?<query>(?:\?(?:(?:(?:[-~!$&'()*+,;=\.\w]|(?:%[a-fA-F\d]{2}))|[:@])|[\/?])*)|)(?<fragment>(?:#(?:(?:(?:[-~!$&'()*+,;=\.\w]|(?:%[a-fA-F\d]{2}))|[:@])|[\/?])*)|)$/u)

Check failure on line 12 in src/lib/object/url.ts

View workflow job for this annotation

GitHub Actions / Build/Publish (dev)

'\p' must be followed by a Unicode property value expression enclosed in braces.

Check failure on line 12 in src/lib/object/url.ts

View workflow job for this annotation

GitHub Actions / Build/Publish (dev)

'\p' must be followed by a Unicode property value expression enclosed in braces.
.exec(string)?.groups ?? {},
http = ["https", "http"].includes(scheme.toLocaleLowerCase());

Expand Down

0 comments on commit 17eb04c

Please sign in to comment.