Solved lgtm and regex sanitization issues

This commit is contained in:
lotte
2021-03-16 18:01:47 +01:00
parent 66463cfc04
commit 0488cd6b45
3 changed files with 10 additions and 2 deletions

View File

@@ -156,7 +156,7 @@ export class Metadata {
const outputKeys: string[] = [];
for (const inputKey of inputKeys) {
if (inputKey.includes('*')) {
const inputKeyRegex = new RegExp('^' + inputKey.replace('.', '\.').replace('*', '.*') + '$');
const inputKeyRegex = new RegExp('^' + inputKey.replace('.', '\\.').replace('*', '.*') + '$');
for (const mapKey of Object.keys(mdMap)) {
if (!outputKeys.includes(mapKey) && inputKeyRegex.test(mapKey)) {
outputKeys.push(mapKey);