Skip to content

Commit 6c94aae

Browse files
Rhiliptux-tn
andauthored
Apply suggestions from code review
Co-authored-by: Sarhan Aissi <[email protected]>
1 parent 369a79c commit 6c94aae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/isMagnetURI.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import assertString from './util/assertString';
22

3-
const magnetURIComponent = /[?&]xt(?:\.1)?=urn:((?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?|btmh:1220[a-z0-9]{64})($|&)/i;
3+
const magnetURIComponent = /(?:^magnet:\?|[^?&]&)xt(?:\.1)?=urn:(?:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?|btmh:1220[a-z0-9]{64})(?:$|&)/i;
44

55
export default function isMagnetURI(url) {
66
assertString(url);

0 commit comments

Comments
 (0)