SAP-BTP-Spielwiese/app1/node_modules/validator/es/lib/isMagnetURI.js
Markus Rettig 775ac7b58c completed step 3 from the tutorial
you must login with an BTP account in order to see the app
2024-02-08 16:13:36 +01:00

6 lines
No EOL
293 B
JavaScript

import assertString from './util/assertString';
var magnetURI = /^magnet:\?xt(?:\.1)?=urn:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?($|&)/i;
export default function isMagnetURI(url) {
assertString(url);
return magnetURI.test(url.trim());
}