Skip to content

Commit

Permalink
fix: linting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
darshan-iterable committed Aug 23, 2024
1 parent 7c0146e commit ed94607
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/anonymousUserTracking/criteriaCompletionChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,9 @@ class CriteriaCompletionChecker {
): boolean {
// eslint-disable-next-line no-restricted-globals
if (Array.isArray(sourceTo)) {
return sourceTo.some((source) => {
return this.compareNumericValues(source, stringValue, compareOperator);
});
return sourceTo.some((source) =>
this.compareNumericValues(source, stringValue, compareOperator)
);

Check failure on line 485 in src/anonymousUserTracking/criteriaCompletionChecker.ts

View workflow job for this annotation

GitHub Actions / build

Unnecessary 'else' after 'return'

Check failure on line 485 in src/anonymousUserTracking/criteriaCompletionChecker.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected use of 'isNaN'. Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan
} else if (!isNaN(parseFloat(stringValue))) {
const sourceNumber = parseFloat(sourceTo);
const numericValue = parseFloat(stringValue);
Expand All @@ -504,9 +504,9 @@ class CriteriaCompletionChecker {

private compareStringContains(sourceTo: any, stringValue: string): boolean {
if (Array.isArray(sourceTo)) {
return sourceTo.some((source) => {
return this.compareStringContains(source, stringValue);
});
return sourceTo.some((source) =>
this.compareStringContains(source, stringValue)
);
}
return (
(typeof sourceTo === 'string' || typeof sourceTo === 'object') &&
Expand All @@ -516,18 +516,16 @@ class CriteriaCompletionChecker {

private compareStringStartsWith(sourceTo: any, stringValue: string): boolean {
if (Array.isArray(sourceTo)) {
return sourceTo.some((source) => {
return this.compareStringStartsWith(source, stringValue);
});
return sourceTo.some((source) =>
this.compareStringStartsWith(source, stringValue)
);
}
return typeof sourceTo === 'string' && sourceTo.startsWith(stringValue);
}

private compareWithRegex(sourceTo: string, pattern: string): boolean {
if (Array.isArray(sourceTo)) {
return sourceTo.some((source) => {
return this.compareWithRegex(source, pattern);
});
return sourceTo.some((source) => this.compareWithRegex(source, pattern));
}
try {
const regexPattern = new RegExp(pattern);
Expand Down

0 comments on commit ed94607

Please sign in to comment.