diff --git a/STYLE.md b/STYLE.md index a38362cf8cbb..3e034f53fb6f 100644 --- a/STYLE.md +++ b/STYLE.md @@ -281,7 +281,7 @@ So, if a new language feature isn't something we have agreed to support it's off Here are a couple of things we would ask that you *avoid* to help maintain consistency in our codebase: - **Async/Await** - Use the native `Promise` instead -- **Optional Chaining** - Use `lodash.get` to fetch a nested value instead +- **Optional Chaining** - Use `lodash/get` to fetch a nested value instead # React Coding Standards diff --git a/package-lock.json b/package-lock.json index ef9532c761e5..f274c3fdf2c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17015,35 +17015,20 @@ } }, "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "lodash.assign": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" }, - "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" - }, - "lodash.has": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/lodash.has/-/lodash.has-4.5.2.tgz", - "integrity": "sha1-0Z9NwQlQWMzL4rDN9O4P5Ko3yGI=" - }, "lodash.isequal": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" }, - "lodash.orderby": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.orderby/-/lodash.orderby-4.6.0.tgz", - "integrity": "sha1-5pfwTOXXhSL1TZM4syuBozk+TrM=" - }, "lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", @@ -17055,11 +17040,6 @@ "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", "integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=" }, - "lodash.transform": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.transform/-/lodash.transform-4.6.0.tgz", - "integrity": "sha1-EjBkIvYzJK7YSD0/ODMrX2cFR6A=" - }, "log-symbols": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", diff --git a/package.json b/package.json index 634fa90c8a9f..8d66a95b3879 100644 --- a/package.json +++ b/package.json @@ -50,10 +50,7 @@ "expensify-common": "git+https://github.com/Expensify/expensify-common.git#b89c2c591a2f76ae1a3d8a4a2e2d5e5159d65edc", "file-loader": "^6.0.0", "html-entities": "^1.3.1", - "lodash.get": "^4.4.2", - "lodash.has": "^4.5.2", - "lodash.orderby": "^4.6.0", - "lodash.transform": "^4.6.0", + "lodash": "4.17.21", "metro-config": "^0.64.0", "moment": "^2.27.0", "moment-timezone": "^0.5.31", diff --git a/src/CONFIG.js b/src/CONFIG.js index 4d41bafbb63f..a24e90b0a2b0 100644 --- a/src/CONFIG.js +++ b/src/CONFIG.js @@ -1,4 +1,4 @@ -import lodashGet from 'lodash.get'; +import lodashGet from 'lodash/get'; import {Platform} from 'react-native'; import Config from 'react-native-config'; import getPlatform from './libs/getPlatform/index'; diff --git a/src/Expensify.js b/src/Expensify.js index 0fa0da2e4104..0e4fb91fbee2 100644 --- a/src/Expensify.js +++ b/src/Expensify.js @@ -1,4 +1,4 @@ -import lodashGet from 'lodash.get'; +import lodashGet from 'lodash/get'; import PropTypes from 'prop-types'; import React, {PureComponent} from 'react'; import {View} from 'react-native'; diff --git a/src/libs/Network.js b/src/libs/Network.js index 8341382948c9..2582e0f737e8 100644 --- a/src/libs/Network.js +++ b/src/libs/Network.js @@ -1,5 +1,5 @@ import _ from 'underscore'; -import lodashGet from 'lodash.get'; +import lodashGet from 'lodash/get'; import Onyx from 'react-native-onyx'; import HttpUtils from './HttpUtils'; import ONYXKEYS from '../ONYXKEYS'; diff --git a/src/libs/Notification/PushNotification/index.native.js b/src/libs/Notification/PushNotification/index.native.js index 17009f9c1731..d649726474b6 100644 --- a/src/libs/Notification/PushNotification/index.native.js +++ b/src/libs/Notification/PushNotification/index.native.js @@ -1,7 +1,7 @@ import _ from 'underscore'; import {AppState} from 'react-native'; import {UrbanAirship, EventType} from 'urbanairship-react-native'; -import lodashGet from 'lodash.get'; +import lodashGet from 'lodash/get'; import NotificationType from './NotificationType'; const notificationEventActionMap = {}; diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index e919f280e3db..143203a45ba2 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -1,8 +1,8 @@ /* eslint-disable no-continue */ import _ from 'underscore'; import Onyx from 'react-native-onyx'; -import lodashGet from 'lodash.get'; -import lodashOrderBy from 'lodash.orderby'; +import lodashGet from 'lodash/get'; +import lodashOrderBy from 'lodash/orderBy'; import Str from 'expensify-common/lib/str'; import {getDefaultAvatar} from './actions/PersonalDetails'; import ONYXKEYS from '../ONYXKEYS'; diff --git a/src/libs/Performance.js b/src/libs/Performance.js index b3a48b453b75..f391c706b998 100644 --- a/src/libs/Performance.js +++ b/src/libs/Performance.js @@ -1,5 +1,5 @@ import _ from 'underscore'; -import lodashTransform from 'lodash.transform'; +import lodashTransform from 'lodash/transform'; /** * Deep diff between two objects. Useful for figuring out what changed about an object from one render to the next so diff --git a/src/libs/actions/NameValuePair.js b/src/libs/actions/NameValuePair.js index ac8fd1d46ca1..2b0740558311 100644 --- a/src/libs/actions/NameValuePair.js +++ b/src/libs/actions/NameValuePair.js @@ -1,6 +1,6 @@ import _ from 'underscore'; import Onyx from 'react-native-onyx'; -import lodashGet from 'lodash.get'; +import lodashGet from 'lodash/get'; import * as API from '../API'; /** diff --git a/src/libs/actions/PersonalDetails.js b/src/libs/actions/PersonalDetails.js index 4faccd19f686..f360f46de279 100644 --- a/src/libs/actions/PersonalDetails.js +++ b/src/libs/actions/PersonalDetails.js @@ -1,5 +1,5 @@ import _ from 'underscore'; -import lodashGet from 'lodash.get'; +import lodashGet from 'lodash/get'; import Onyx from 'react-native-onyx'; import Str from 'expensify-common/lib/str'; import ONYXKEYS from '../../ONYXKEYS'; diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 668000529b7e..2bf879dacd4e 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1,6 +1,6 @@ import moment from 'moment'; import _ from 'underscore'; -import lodashGet from 'lodash.get'; +import lodashGet from 'lodash/get'; import ExpensiMark from 'expensify-common/lib/ExpensiMark'; import Onyx from 'react-native-onyx'; import ONYXKEYS from '../../ONYXKEYS'; diff --git a/src/libs/actions/User.js b/src/libs/actions/User.js index 01e4870d4f07..267569a48bc5 100644 --- a/src/libs/actions/User.js +++ b/src/libs/actions/User.js @@ -1,5 +1,5 @@ import _ from 'underscore'; -import lodashGet from 'lodash.get'; +import lodashGet from 'lodash/get'; import Onyx from 'react-native-onyx'; import ONYXKEYS from '../../ONYXKEYS'; import * as API from '../API'; diff --git a/src/libs/translate.js b/src/libs/translate.js index 2d301400fcf5..64ad70c18d2b 100644 --- a/src/libs/translate.js +++ b/src/libs/translate.js @@ -1,4 +1,4 @@ -import lodashGet from 'lodash.get'; +import lodashGet from 'lodash/get'; import Str from 'expensify-common/lib/str'; import Log from './Log'; import Config from '../CONFIG'; diff --git a/src/pages/SetPasswordPage.js b/src/pages/SetPasswordPage.js index ca6925dc88a6..79679dca6141 100644 --- a/src/pages/SetPasswordPage.js +++ b/src/pages/SetPasswordPage.js @@ -8,7 +8,7 @@ import { import PropTypes from 'prop-types'; import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; -import lodashGet from 'lodash.get'; +import lodashGet from 'lodash/get'; import styles from '../styles/styles'; import ExpensifyCashLogo from '../../assets/images/expensify-cash.svg'; import {setPassword} from '../libs/actions/Session'; diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index 250415280d66..442a0af162df 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -2,7 +2,7 @@ import React from 'react'; import {View, Pressable} from 'react-native'; import PropTypes from 'prop-types'; import {withOnyx} from 'react-native-onyx'; -import lodashGet from 'lodash.get'; +import lodashGet from 'lodash/get'; import styles from '../../styles/styles'; import ONYXKEYS from '../../ONYXKEYS'; import themeColors from '../../styles/themes/default'; diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 7bc8c8761c02..e6a01ff7a77f 100644 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -2,7 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import {View, TouchableOpacity} from 'react-native'; import _ from 'underscore'; -import lodashGet from 'lodash.get'; +import lodashGet from 'lodash/get'; import {withOnyx} from 'react-native-onyx'; import styles from '../../../styles/styles'; import themeColors from '../../../styles/themes/default'; diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js index 9fc3d0a42542..fc867be054d7 100644 --- a/src/pages/home/report/ReportActionsView.js +++ b/src/pages/home/report/ReportActionsView.js @@ -8,7 +8,7 @@ import { } from 'react-native'; import PropTypes from 'prop-types'; import _ from 'underscore'; -import lodashGet from 'lodash.get'; +import lodashGet from 'lodash/get'; import {withOnyx} from 'react-native-onyx'; import Text from '../../../components/Text'; import UnreadActionIndicator from '../../../components/UnreadActionIndicator';