swc/bundler/tests/.cache/deno/7e17928999646c49e71cacee35d6f7300f2ed537.ts
강동윤 bbaf619f63
fix(bundler): Fix bugs (#1437)
swc_bundler:
 - [x] Fix wrapped esms. (denoland/deno#9307)
 - [x] Make test secure.
2021-03-02 17:33:03 +09:00

16 lines
386 B
TypeScript

// Loaded from https://deno.land/x/segno@v1.1.0/lib/validations/isMagnetURI.ts
// @ts-ignore allowing typedoc to build
import { assertString } from '../helpers/assertString.ts';
/**
* @ignore
*/
const magnetURI = /^magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32,40}&dn=.+&tr=.+$/i;
export const isMagnetURI = (url: string) => {
assertString(url);
return magnetURI.test(url.trim());
};