-
Notifications
You must be signed in to change notification settings - Fork 71
Implements getFlag method #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: refreshed-ui
Are you sure you want to change the base?
Conversation
ui/src/lib/RegexBuilder.js
Outdated
const decoded = decodeURIComponent(atob(rawData)); | ||
return JSON.parse(decoded); | ||
} else if (typeof rawData === 'object' && rawData !== null) { | ||
} else if (typeof rawData === "object" && rawData !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. Single quotes
ui/src/lib/RegexBuilder.js
Outdated
@@ -24,7 +24,7 @@ export default class RegexBuilder { | |||
regex: this.source, | |||
flags: this.getFlag(), | |||
match_type: this.matchType, | |||
test_string: this.testString, | |||
test_string: this.testString |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. trailing ,
ui/src/lib/RegexBuilder.js
Outdated
@@ -39,11 +39,15 @@ export default class RegexBuilder { | |||
.reduce( | |||
(acc, [key, value]) => ({ | |||
...acc, | |||
[key]: false, | |||
[key]: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. trailing ,
ui/src/lib/RegexBuilder.js
Outdated
}), | ||
{} | ||
); | ||
} | ||
|
||
getFlag() {} | ||
getFlag() { | ||
return Object.keys(this.flags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to be sure that we get all values for REGEX_FLAGS
, what about start this with Object.keys(REGEX_FLAGS)
?
ui/src/lib/RegexBuilder.js
Outdated
@@ -15,7 +15,7 @@ export default class RegexBuilder { | |||
this.flags = {}; | |||
this.source = data.regex || null; | |||
this.testString = data.test_string || null; | |||
this.matchType = data.match_type || 'match'; | |||
this.matchType = data.match_type || "match"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same (about quotes)
ui/src/lib/RegexBuilder.js
Outdated
|
||
export default class RegexBuilder { | ||
constructor(rawData) { | ||
const data = (() => { | ||
if (typeof rawData === 'string') { | ||
if (typeof rawData === "string") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same (about quotes)
ui/src/lib/RegexBuilder.js
Outdated
@@ -1,12 +1,12 @@ | |||
import { REGEX_FLAGS } from '../constants'; | |||
import { REGEX_FLAGS } from "../constants"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same (about quotes)
No description provided.