Skip to content

Commit

Permalink
fix: exclude windows drive letters from protocols (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Nov 2, 2021
1 parent 1205940 commit 94d3506
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/_utils.ts
Expand Up @@ -39,7 +39,8 @@ export function matchAll (regex, string, addition) {
return matches
}

const ProtocolRegex = /^(?<proto>.+):.+$/
// 2+ letters, to exclude Windows drive letters
const ProtocolRegex = /^(?<proto>.{2,}):.+$/

export function getProtocol (id: string): string | null {
const proto = id.match(ProtocolRegex)
Expand Down

0 comments on commit 94d3506

Please sign in to comment.