scttcper / video-filename-parser

Scene release name parser

Home Page:https://video-filename-parser.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I have an error with the regex on aacAtmosCodecExp

chadacious opened this issue ยท comments

Great package! Thanks.

However, initially, I got a hard fail using this package due to one of the regular expressions in audioCodec.js.

const aacAtmosCodecExp = /\b(?<aac>(AAC(?:ch)?(?=[^\d]|$)?))/i;
changing it to this fixed it:
const aacAtmosCodecExp = /\b(?<aac>(AAC(?:ch)?(?=[^\d]|$)))/i;

The error I received was:

Failed to compile.

./node_modules/@ctrl/video-filename-parser/dist/audioCodec.js
SyntaxError: C:\Projects\enjoy\sites\joyify-website\node_modules\@ctrl\video-filename-parser\dist\audioCodec.js: Expected atom at position 31
    ?=[^\d]|$)?))
              ^

I put your regular expression in https://regex101.com/ and it says about that last question mark:

A quantifier following a lookaround serves no purpose, and can safely be removed from the regular expression

๐ŸŽ‰ This issue has been resolved in version 1.6.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

That's interesting, you might check your node version. I'm using this with v12.14.0 and it seems to be working fine. Anyway i changed it around, hopefully that works.