Skip to content

Commit

Permalink
Merge pull request #728 from Expensify/snyk-upgrade-e7a3dff6ae5c7bf95…
Browse files Browse the repository at this point in the history
…cfc47123f96a23c

[Snyk] Upgrade eslint-config-expensify from 2.0.48 to 2.0.50
  • Loading branch information
thienlnam authored Jun 24, 2024
2 parents 20e630e + 9d8b39b commit dd4e954
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lib/Cookie.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function enabled() {
const cookieName = `cookieTest_${Math.floor(Math.random() * 1000)}`;
const cookieValue = 'enabled';
set(cookieName, cookieValue, 1);
const result = Boolean(document.cookie.indexOf(cookieName) >= 0) || false;
const result = document.cookie.indexOf(cookieName) >= 0 || false;
if (result) {
remove(cookieName);
}
Expand Down
9 changes: 4 additions & 5 deletions lib/components/form/element/combobox.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ class Combobox extends React.Component {

const formatOption = (option) => ({
focused: false,
isSelected: option.selected && (isEqual(option.value, currentValue) || Boolean(alreadySelected.find((item) => item.value === option.value))),
isSelected: option.selected && (isEqual(option.value, currentValue) || !!alreadySelected.find((item) => item.value === option.value)),
...option,
});

Expand Down Expand Up @@ -551,7 +551,7 @@ class Combobox extends React.Component {
const deselectOption = (initialOption) => {
const option = initialOption;
const isSelected = isEqual(option.value, val);
option.isSelected = isSelected || Boolean(this.props.alreadySelectedOptions.find((optionItem) => optionItem.value === option.value));
option.isSelected = isSelected || !!this.props.alreadySelectedOptions.find((optionItem) => optionItem.value === option.value);

return option;
};
Expand Down Expand Up @@ -655,7 +655,7 @@ class Combobox extends React.Component {
}
const state = this.getStartState(noDefaultValue, this.options, newAlreadySelectedOptions);
const handleDropdownStateChange = () => {
this.props.onDropdownStateChange(Boolean(state.isDropdownOpen));
this.props.onDropdownStateChange(!!state.isDropdownOpen);
};
this.setState(state, handleDropdownStateChange);
}
Expand Down Expand Up @@ -859,8 +859,7 @@ class Combobox extends React.Component {
const formatOption = (option) => ({
focused: false,
isSelected:
isEqual(option.value ? option.value.toUpperCase : '', value.toUpperCase()) ||
Boolean(this.props.alreadySelectedOptions.find((optionItem) => optionItem.value === option.value)),
isEqual(option.value ? option.value.toUpperCase : '', value.toUpperCase()) || !!this.props.alreadySelectedOptions.find((optionItem) => optionItem.value === option.value),
...option,
});

Expand Down
10 changes: 5 additions & 5 deletions lib/str.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ const Str = {
* @returns True if the string is a domain name
*/
isValidDomainName(str: string): boolean {
return Boolean(String(str).match(Constants.CONST.REG_EXP.DOMAIN));
return !!String(str).match(Constants.CONST.REG_EXP.DOMAIN);
},

/**
Expand All @@ -359,7 +359,7 @@ const Str = {
* @returns True if the string is a valid hyperlink
*/
isValidURL(str: string): boolean {
return Boolean(String(str).match(Constants.CONST.REG_EXP.HYPERLINK));
return !!String(str).match(Constants.CONST.REG_EXP.HYPERLINK);
},

/**
Expand All @@ -371,7 +371,7 @@ const Str = {
* @returns True if the string is an email
*/
isValidEmail(str: string): boolean {
return Boolean(String(str).match(Constants.CONST.REG_EXP.EMAIL));
return !!String(str).match(Constants.CONST.REG_EXP.EMAIL);
},

/**
Expand All @@ -382,7 +382,7 @@ const Str = {
* @returns True if the string is an valid email created by comment markdown.
*/
isValidEmailMarkdown(str: string): boolean {
return Boolean(String(str).match(`^${Constants.CONST.REG_EXP.MARKDOWN_EMAIL}$`));
return !!String(str).match(`^${Constants.CONST.REG_EXP.MARKDOWN_EMAIL}$`);
},

/**
Expand Down Expand Up @@ -818,7 +818,7 @@ const Str = {
if (this.isString(value)) {
return value.toLowerCase() === 'true';
}
return Boolean(value);
return !!value;
},

/**
Expand Down
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"babel-jest": "^29.0.0",
"babelify": "10.0.0",
"eslint": "^8.57.0",
"eslint-config-expensify": "^2.0.48",
"eslint-config-expensify": "^2.0.50",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-jest": "^28.6.0",
"eslint-plugin-prettier": "^5.1.3",
Expand Down

0 comments on commit dd4e954

Please sign in to comment.