X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fregexp.ts;h=257054cead9c076744a0ac18266c110d5c306024;hb=4c6757f2fd2111e51e51e1b0d8f21f3b5e16ff40;hp=2336654b0d3ee73421593ad9a9d5083e60df7c35;hpb=73471b1a52f242e86364ffb077ea6cadb3b07ae2;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/regexp.ts b/server/helpers/regexp.ts index 2336654b0..257054cea 100644 --- a/server/helpers/regexp.ts +++ b/server/helpers/regexp.ts @@ -1,10 +1,9 @@ // Thanks to https://regex101.com function regexpCapture (str: string, regex: RegExp, maxIterations = 100) { + const result: RegExpExecArray[] = [] let m: RegExpExecArray let i = 0 - let result: RegExpExecArray[] = [] - // tslint:disable:no-conditional-assignment while ((m = regex.exec(str)) !== null && i < maxIterations) { // This is necessary to avoid infinite loops with zero-width matches if (m.index === regex.lastIndex) {