You can just replace this line:
const regex = new RegExp(`Section${sectionId}.json$`);
With this one:
const regex = RegExp(`Section${sectionId}.json$`);
I just removed the new keyword.
new