Skip to content

Commit

Permalink
deps(lodash): replace lodash per-method packages with full lodash (
Browse files Browse the repository at this point in the history
  • Loading branch information
mhassan1 committed Mar 1, 2022
1 parent 0d88dd5 commit 2cef5c9
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 69 deletions.
4 changes: 3 additions & 1 deletion lighthouse-cli/test/smokehouse/frontends/lib.js
Expand Up @@ -13,11 +13,13 @@

/* eslint-disable no-console */

import cloneDeep from 'lodash.clonedeep';
import _ from 'lodash';

import smokeTests from '../core-tests.js';
import {runSmokehouse, getShardedDefinitions} from '../smokehouse.js';

const {cloneDeep} = _;

/**
* @param {Smokehouse.SmokehouseLibOptions} options
*/
Expand Down
4 changes: 3 additions & 1 deletion lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js
Expand Up @@ -17,7 +17,7 @@ import path from 'path';
import fs from 'fs';
import url from 'url';

import cloneDeep from 'lodash.clonedeep';
import _ from 'lodash';
import yargs from 'yargs';
import * as yargsHelpers from 'yargs/helpers';
import log from 'lighthouse-logger';
Expand All @@ -26,6 +26,8 @@ import {runSmokehouse, getShardedDefinitions} from '../smokehouse.js';
import {updateTestDefnFormat} from './back-compat-util.js';
import {LH_ROOT} from '../../../../root.js';

const {cloneDeep} = _;

const coreTestDefnsPath =
path.join(LH_ROOT, 'lighthouse-cli/test/smokehouse/core-tests.js');

Expand Down
4 changes: 3 additions & 1 deletion lighthouse-cli/test/smokehouse/report-assert.js
Expand Up @@ -10,11 +10,13 @@
* against the results actually collected from Lighthouse.
*/

import cloneDeep from 'lodash.clonedeep';
import _ from 'lodash';
import log from 'lighthouse-logger';

import {LocalConsole} from './lib/local-console.js';

const {cloneDeep} = _;

/**
* @typedef Difference
* @property {string} path
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/config/config-helpers.js
Expand Up @@ -6,7 +6,7 @@
'use strict';

const path = require('path');
const isDeepEqual = require('lodash.isequal');
const {isEqual: isDeepEqual} = require('lodash');
const constants = require('./constants.js');
const Budget = require('./budget.js');
const ConfigPlugin = require('./config-plugin.js');
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/fraggle-rock/gather/base-artifacts.js
Expand Up @@ -6,7 +6,7 @@
'use strict';

const log = require('lighthouse-logger');
const isEqual = require('lodash.isequal');
const {isEqual} = require('lodash');
const {
getBrowserVersion,
getBenchmarkIndex,
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/lib/arbitrary-equality-map.js
Expand Up @@ -5,7 +5,7 @@
*/
'use strict';

const isEqual = require('lodash.isequal');
const {isEqual} = require('lodash');

/**
* @fileoverview This class is designed to allow maps with arbitrary equality functions.
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/runner.js
Expand Up @@ -5,7 +5,7 @@
*/
'use strict';

const isDeepEqual = require('lodash.isequal');
const {isEqual: isDeepEqual} = require('lodash');
const Driver = require('./gather/driver.js');
const GatherRunner = require('./gather/gather-runner.js');
const ReportScoring = require('./scoring.js');
Expand Down
10 changes: 2 additions & 8 deletions package.json
Expand Up @@ -115,10 +115,7 @@
"@types/jest": "^27.0.3",
"@types/jpeg-js": "^0.3.7",
"@types/jsdom": "^16.2.13",
"@types/lodash.clonedeep": "^4.5.6",
"@types/lodash.get": "^4.4.6",
"@types/lodash.isequal": "^4.5.2",
"@types/lodash.set": "^4.3.6",
"@types/lodash": "^4.14.178",
"@types/node": "*",
"@types/pako": "^1.0.1",
"@types/resize-observer-browser": "^0.1.1",
Expand Down Expand Up @@ -195,10 +192,7 @@
"js-library-detector": "^6.4.0",
"lighthouse-logger": "^1.3.0",
"lighthouse-stack-packs": "^1.7.0",
"lodash.clonedeep": "^4.5.0",
"lodash.get": "^4.4.2",
"lodash.isequal": "^4.5.0",
"lodash.set": "^4.3.2",
"lodash": "^4.17.21",
"lookup-closest-locale": "6.2.0",
"metaviewport-parser": "0.2.0",
"open": "^8.4.0",
Expand Down
3 changes: 1 addition & 2 deletions shared/localization/swap-locale.js
Expand Up @@ -5,8 +5,7 @@
*/
'use strict';

const _set = require('lodash.set');
const _get = require('lodash.get');
const {set: _set, get: _get} = require('lodash');

const format = require('./format.js');

Expand Down
56 changes: 4 additions & 52 deletions yarn.lock
Expand Up @@ -1639,38 +1639,10 @@
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4=

"@types/lodash.clonedeep@^4.5.6":
version "4.5.6"
resolved "https://registry.yarnpkg.com/@types/lodash.clonedeep/-/lodash.clonedeep-4.5.6.tgz#3b6c40a0affe0799a2ce823b440a6cf33571d32b"
integrity sha512-cE1jYr2dEg1wBImvXlNtp0xDoS79rfEdGozQVgliDZj1uERH4k+rmEMTudP9b4VQ8O6nRb5gPqft0QzEQGMQgA==
dependencies:
"@types/lodash" "*"

"@types/lodash.get@^4.4.6":
version "4.4.6"
resolved "https://registry.yarnpkg.com/@types/lodash.get/-/lodash.get-4.4.6.tgz#0c7ac56243dae0f9f09ab6f75b29471e2e777240"
integrity sha512-E6zzjR3GtNig8UJG/yodBeJeIOtgPkMgsLjDU3CbgCAPC++vJ0eCMnJhVpRZb/ENqEFlov1+3K9TKtY4UdWKtQ==
dependencies:
"@types/lodash" "*"

"@types/lodash.isequal@^4.5.2":
version "4.5.2"
resolved "https://registry.yarnpkg.com/@types/lodash.isequal/-/lodash.isequal-4.5.2.tgz#adbdff67f7c956ed703009e5466a34eeddb0b712"
integrity sha512-RBgio5IF9ND5Sw7pIivcC47oLY65f5UQCblnjVoGLR5wykwSRd/q0k6aUroXMGZfu8jnyJbNhzNC+NcFUnJ8pA==
dependencies:
"@types/lodash" "*"

"@types/lodash.set@^4.3.6":
version "4.3.6"
resolved "https://registry.yarnpkg.com/@types/lodash.set/-/lodash.set-4.3.6.tgz#33e635c2323f855359225df6a5c8c6f1f1908264"
integrity sha512-ZeGDDlnRYTvS31Laij0RsSaguIUSBTYIlJFKL3vm3T2OAZAQj2YpSvVWJc0WiG4jqg9fGX6PAPGvDqBcHfSgFg==
dependencies:
"@types/lodash" "*"

"@types/lodash@*":
version "4.14.106"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.106.tgz#6093e9a02aa567ddecfe9afadca89e53e5dce4dd"
integrity sha512-tOSvCVrvSqFZ4A/qrqqm6p37GZoawsZtoR0SJhlF7EonNZUgrn8FfT+RNQ11h+NUpMt6QVe36033f3qEKBwfWA==
"@types/lodash@^4.14.178":
version "4.14.178"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8"
integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==

"@types/long@^4.0.1":
version "4.0.1"
Expand Down Expand Up @@ -5708,11 +5680,6 @@ lodash.camelcase@^4.3.0:
resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6"
integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY=

lodash.clonedeep@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=

lodash.defaults@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c"
Expand All @@ -5728,16 +5695,6 @@ lodash.flatten@^4.4.0:
resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f"
integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=

lodash.get@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=

lodash.isequal@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA=

lodash.ismatch@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37"
Expand All @@ -5753,11 +5710,6 @@ lodash.merge@^4.6.2:
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==

lodash.set@^4.3.2:
version "4.3.2"
resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23"
integrity sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=

lodash.sortby@^4.7.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
Expand Down

0 comments on commit 2cef5c9

Please sign in to comment.