mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Refactoring the regex codes
This commit is contained in:
parent
6b1e089937
commit
786e87bde5
1 changed files with 1 additions and 3 deletions
|
@ -18,11 +18,9 @@ module.exports = function applyFilterToKey(obj, key, action) {
|
|||
}
|
||||
else if (/\/.+\//.test(action)) {
|
||||
var matches = action.match(/\/(.+)\//);
|
||||
try {
|
||||
if (matches) {
|
||||
let regex = new RegExp(matches[1]);
|
||||
obj[k] = ('' + val).replace(regex, replacer);
|
||||
} catch (e) {
|
||||
//meh
|
||||
}
|
||||
}
|
||||
} else if (typeof val === 'object') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue