Skip to content
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

Implements getFlag method #31

Open
wants to merge 3 commits into
base: refreshed-ui
Choose a base branch
from

Conversation

elizeusdsantos
Copy link

No description provided.

const decoded = decodeURIComponent(atob(rawData));
return JSON.parse(decoded);
} else if (typeof rawData === 'object' && rawData !== null) {
} else if (typeof rawData === "object" && rawData !== null) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. Single quotes

@@ -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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. trailing ,

@@ -39,11 +39,15 @@ export default class RegexBuilder {
.reduce(
(acc, [key, value]) => ({
...acc,
[key]: false,
[key]: false
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. trailing ,

}),
{}
);
}

getFlag() {}
getFlag() {
return Object.keys(this.flags)
Copy link
Owner

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)?

@@ -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";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same (about quotes)


export default class RegexBuilder {
constructor(rawData) {
const data = (() => {
if (typeof rawData === 'string') {
if (typeof rawData === "string") {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same (about quotes)

@@ -1,12 +1,12 @@
import { REGEX_FLAGS } from '../constants';
import { REGEX_FLAGS } from "../constants";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same (about quotes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants