You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- We already do toLowerCase(), so don't need i flag.
- We're not using the http bit, so no need to capture it.
- If there's an s, append it, if not don't. This is the same as just
replacing http with ws:
[http]:// -> [ws]://
[http]s:// -> [ws]s://
[http]x:// -> [ws]x:// -> error. Is ok.
[http]sx:// -> [ws]sx:// -> error in both. Is ok.
- We don't want to replace protocols that do not start with http, such
as git+https, so we can anchor at string start and leave out the g
flag.
Much simpler -:)
0 commit comments