Merge pull request #973 from mikepenz/fix/965
Fix `undefined` for `match` regex
This commit is contained in:
+1
-1
@@ -1890,7 +1890,7 @@ function extractValuesFromString(value, extractor) {
|
|||||||
if (extractor.method === 'match') {
|
if (extractor.method === 'match') {
|
||||||
const lables = value.match(extractor.pattern);
|
const lables = value.match(extractor.pattern);
|
||||||
if (lables !== null && lables.length > 0) {
|
if (lables !== null && lables.length > 0) {
|
||||||
return lables.map(label => label.toLocaleLowerCase('en'));
|
return lables.map(label => (label === null || label === void 0 ? void 0 : label.toLocaleLowerCase('en')) || '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -483,7 +483,7 @@ function extractValuesFromString(value: string, extractor: RegexTransformer): st
|
|||||||
if (extractor.method === 'match') {
|
if (extractor.method === 'match') {
|
||||||
const lables = value.match(extractor.pattern)
|
const lables = value.match(extractor.pattern)
|
||||||
if (lables !== null && lables.length > 0) {
|
if (lables !== null && lables.length > 0) {
|
||||||
return lables.map(label => label.toLocaleLowerCase('en'))
|
return lables.map(label => label?.toLocaleLowerCase('en') || '')
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const label = value.replace(extractor.pattern, extractor.target)
|
const label = value.replace(extractor.pattern, extractor.target)
|
||||||
|
|||||||
Reference in New Issue
Block a user