Skip to content

v1.1.1 - Fix fileMatch runtime error

Choose a tag to compare

@tmogeid tmogeid released this 20 Jul 15:48
· 9 commits to main since this release

Bug Fix

Fixes undefined is not object (evaluating fileMatch[1].replace) runtime error in chat.message hook.

Root Cause

When .match() is used with a regex that has the global flag g, JavaScript returns an array of complete matches without capture groups. This caused fileMatch[1] to be undefined.

Fix

Changed to matchAll() which correctly returns capture groups, consistent with session-manager.ts.

Files Changed

  • src/episode-detector.ts lines 99-120: .match() to matchAll() + for...of loop