expensify-common
Advanced tools
Comparing version 2.0.25 to 2.0.26
@@ -420,3 +420,3 @@ "use strict"; | ||
const splitOptions = dividerIndex ? [this.options.slice(0, dividerIndex + 1), this.options.slice(dividerIndex + 1)] : [this.options]; | ||
const formatOption = (option) => (Object.assign({ focused: false, isSelected: option.selected && ((0, lodash_1.isEqual)(option.value, currentValue) || Boolean(alreadySelected.find((item) => item.value === option.value))) }, option)); | ||
const formatOption = (option) => (Object.assign({ focused: false, isSelected: option.selected && ((0, lodash_1.isEqual)(option.value, currentValue) || !!alreadySelected.find((item) => item.value === option.value)) }, option)); | ||
const sortByOption = (o) => { | ||
@@ -476,3 +476,3 @@ // Unselectable text-only entries (isFake: true) go to the bottom and selected entries go to the top only if alwaysShowSelectedOnTop was passed | ||
const isSelected = (0, lodash_1.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; | ||
@@ -567,3 +567,3 @@ }; | ||
const handleDropdownStateChange = () => { | ||
this.props.onDropdownStateChange(Boolean(state.isDropdownOpen)); | ||
this.props.onDropdownStateChange(!!state.isDropdownOpen); | ||
}; | ||
@@ -745,4 +745,3 @@ this.setState(state, handleDropdownStateChange); | ||
matches = Array.from(matches); | ||
const formatOption = (option) => (Object.assign({ focused: false, isSelected: (0, lodash_1.isEqual)(option.value ? option.value.toUpperCase : '', value.toUpperCase()) || | ||
Boolean(this.props.alreadySelectedOptions.find((optionItem) => optionItem.value === option.value)) }, option)); | ||
const formatOption = (option) => (Object.assign({ focused: false, isSelected: (0, lodash_1.isEqual)(option.value ? option.value.toUpperCase : '', value.toUpperCase()) || !!this.props.alreadySelectedOptions.find((optionItem) => optionItem.value === option.value) }, option)); | ||
const options = matches.map(formatOption); | ||
@@ -749,0 +748,0 @@ // Focus the first option if there is one and show a message dependent on what options are present |
@@ -70,3 +70,3 @@ "use strict"; | ||
set(cookieName, cookieValue, 1); | ||
const result = Boolean(document.cookie.indexOf(cookieName) >= 0) || false; | ||
const result = document.cookie.indexOf(cookieName) >= 0 || false; | ||
if (result) { | ||
@@ -73,0 +73,0 @@ remove(cookieName); |
@@ -336,3 +336,3 @@ "use strict"; | ||
isValidDomainName(str) { | ||
return Boolean(String(str).match(Constants.CONST.REG_EXP.DOMAIN)); | ||
return !!String(str).match(Constants.CONST.REG_EXP.DOMAIN); | ||
}, | ||
@@ -345,3 +345,3 @@ /** | ||
isValidURL(str) { | ||
return Boolean(String(str).match(Constants.CONST.REG_EXP.HYPERLINK)); | ||
return !!String(str).match(Constants.CONST.REG_EXP.HYPERLINK); | ||
}, | ||
@@ -357,3 +357,3 @@ /** | ||
isValidEmail(str) { | ||
return Boolean(String(str).match(Constants.CONST.REG_EXP.EMAIL)); | ||
return !!String(str).match(Constants.CONST.REG_EXP.EMAIL); | ||
}, | ||
@@ -368,3 +368,3 @@ /** | ||
isValidEmailMarkdown(str) { | ||
return Boolean(String(str).match(`^${Constants.CONST.REG_EXP.MARKDOWN_EMAIL}$`)); | ||
return !!String(str).match(`^${Constants.CONST.REG_EXP.MARKDOWN_EMAIL}$`); | ||
}, | ||
@@ -759,3 +759,3 @@ /** | ||
} | ||
return Boolean(value); | ||
return !!value; | ||
}, | ||
@@ -762,0 +762,0 @@ /** |
{ | ||
"name": "expensify-common", | ||
"version": "2.0.25", | ||
"version": "2.0.26", | ||
"author": "Expensify, Inc.", | ||
@@ -59,3 +59,3 @@ "description": "Expensify libraries and components shared across different repos", | ||
"eslint": "^8.57.0", | ||
"eslint-config-expensify": "^2.0.48", | ||
"eslint-config-expensify": "^2.0.50", | ||
"eslint-config-prettier": "^8.10.0", | ||
@@ -62,0 +62,0 @@ "eslint-plugin-jest": "^28.6.0", |
489780
11013