Skip to content

Commit 2cef5c9

Browse files
authoredMar 1, 2022
deps(lodash): replace lodash per-method packages with full lodash (#13695)
1 parent 0d88dd5 commit 2cef5c9

File tree

10 files changed

+20
-69
lines changed

10 files changed

+20
-69
lines changed
 

‎lighthouse-cli/test/smokehouse/frontends/lib.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313

1414
/* eslint-disable no-console */
1515

16-
import cloneDeep from 'lodash.clonedeep';
16+
import _ from 'lodash';
1717

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

21+
const {cloneDeep} = _;
22+
2123
/**
2224
* @param {Smokehouse.SmokehouseLibOptions} options
2325
*/

‎lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import path from 'path';
1717
import fs from 'fs';
1818
import url from 'url';
1919

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

29+
const {cloneDeep} = _;
30+
2931
const coreTestDefnsPath =
3032
path.join(LH_ROOT, 'lighthouse-cli/test/smokehouse/core-tests.js');
3133

‎lighthouse-cli/test/smokehouse/report-assert.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
* against the results actually collected from Lighthouse.
1111
*/
1212

13-
import cloneDeep from 'lodash.clonedeep';
13+
import _ from 'lodash';
1414
import log from 'lighthouse-logger';
1515

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

18+
const {cloneDeep} = _;
19+
1820
/**
1921
* @typedef Difference
2022
* @property {string} path

‎lighthouse-core/config/config-helpers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
'use strict';
77

88
const path = require('path');
9-
const isDeepEqual = require('lodash.isequal');
9+
const {isEqual: isDeepEqual} = require('lodash');
1010
const constants = require('./constants.js');
1111
const Budget = require('./budget.js');
1212
const ConfigPlugin = require('./config-plugin.js');

‎lighthouse-core/fraggle-rock/gather/base-artifacts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
'use strict';
77

88
const log = require('lighthouse-logger');
9-
const isEqual = require('lodash.isequal');
9+
const {isEqual} = require('lodash');
1010
const {
1111
getBrowserVersion,
1212
getBenchmarkIndex,

‎lighthouse-core/lib/arbitrary-equality-map.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
'use strict';
77

8-
const isEqual = require('lodash.isequal');
8+
const {isEqual} = require('lodash');
99

1010
/**
1111
* @fileoverview This class is designed to allow maps with arbitrary equality functions.

‎lighthouse-core/runner.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
'use strict';
77

8-
const isDeepEqual = require('lodash.isequal');
8+
const {isEqual: isDeepEqual} = require('lodash');
99
const Driver = require('./gather/driver.js');
1010
const GatherRunner = require('./gather/gather-runner.js');
1111
const ReportScoring = require('./scoring.js');

‎package.json

+2-8
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,7 @@
115115
"@types/jest": "^27.0.3",
116116
"@types/jpeg-js": "^0.3.7",
117117
"@types/jsdom": "^16.2.13",
118-
"@types/lodash.clonedeep": "^4.5.6",
119-
"@types/lodash.get": "^4.4.6",
120-
"@types/lodash.isequal": "^4.5.2",
121-
"@types/lodash.set": "^4.3.6",
118+
"@types/lodash": "^4.14.178",
122119
"@types/node": "*",
123120
"@types/pako": "^1.0.1",
124121
"@types/resize-observer-browser": "^0.1.1",
@@ -195,10 +192,7 @@
195192
"js-library-detector": "^6.4.0",
196193
"lighthouse-logger": "^1.3.0",
197194
"lighthouse-stack-packs": "^1.7.0",
198-
"lodash.clonedeep": "^4.5.0",
199-
"lodash.get": "^4.4.2",
200-
"lodash.isequal": "^4.5.0",
201-
"lodash.set": "^4.3.2",
195+
"lodash": "^4.17.21",
202196
"lookup-closest-locale": "6.2.0",
203197
"metaviewport-parser": "0.2.0",
204198
"open": "^8.4.0",

‎shared/localization/swap-locale.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
*/
66
'use strict';
77

8-
const _set = require('lodash.set');
9-
const _get = require('lodash.get');
8+
const {set: _set, get: _get} = require('lodash');
109

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

‎yarn.lock

+4-52
Original file line numberDiff line numberDiff line change
@@ -1639,38 +1639,10 @@
16391639
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
16401640
integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4=
16411641

1642-
"@types/lodash.clonedeep@^4.5.6":
1643-
version "4.5.6"
1644-
resolved "https://registry.yarnpkg.com/@types/lodash.clonedeep/-/lodash.clonedeep-4.5.6.tgz#3b6c40a0affe0799a2ce823b440a6cf33571d32b"
1645-
integrity sha512-cE1jYr2dEg1wBImvXlNtp0xDoS79rfEdGozQVgliDZj1uERH4k+rmEMTudP9b4VQ8O6nRb5gPqft0QzEQGMQgA==
1646-
dependencies:
1647-
"@types/lodash" "*"
1648-
1649-
"@types/lodash.get@^4.4.6":
1650-
version "4.4.6"
1651-
resolved "https://registry.yarnpkg.com/@types/lodash.get/-/lodash.get-4.4.6.tgz#0c7ac56243dae0f9f09ab6f75b29471e2e777240"
1652-
integrity sha512-E6zzjR3GtNig8UJG/yodBeJeIOtgPkMgsLjDU3CbgCAPC++vJ0eCMnJhVpRZb/ENqEFlov1+3K9TKtY4UdWKtQ==
1653-
dependencies:
1654-
"@types/lodash" "*"
1655-
1656-
"@types/lodash.isequal@^4.5.2":
1657-
version "4.5.2"
1658-
resolved "https://registry.yarnpkg.com/@types/lodash.isequal/-/lodash.isequal-4.5.2.tgz#adbdff67f7c956ed703009e5466a34eeddb0b712"
1659-
integrity sha512-RBgio5IF9ND5Sw7pIivcC47oLY65f5UQCblnjVoGLR5wykwSRd/q0k6aUroXMGZfu8jnyJbNhzNC+NcFUnJ8pA==
1660-
dependencies:
1661-
"@types/lodash" "*"
1662-
1663-
"@types/lodash.set@^4.3.6":
1664-
version "4.3.6"
1665-
resolved "https://registry.yarnpkg.com/@types/lodash.set/-/lodash.set-4.3.6.tgz#33e635c2323f855359225df6a5c8c6f1f1908264"
1666-
integrity sha512-ZeGDDlnRYTvS31Laij0RsSaguIUSBTYIlJFKL3vm3T2OAZAQj2YpSvVWJc0WiG4jqg9fGX6PAPGvDqBcHfSgFg==
1667-
dependencies:
1668-
"@types/lodash" "*"
1669-
1670-
"@types/lodash@*":
1671-
version "4.14.106"
1672-
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.106.tgz#6093e9a02aa567ddecfe9afadca89e53e5dce4dd"
1673-
integrity sha512-tOSvCVrvSqFZ4A/qrqqm6p37GZoawsZtoR0SJhlF7EonNZUgrn8FfT+RNQ11h+NUpMt6QVe36033f3qEKBwfWA==
1642+
"@types/lodash@^4.14.178":
1643+
version "4.14.178"
1644+
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8"
1645+
integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==
16741646

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

5711-
lodash.clonedeep@^4.5.0:
5712-
version "4.5.0"
5713-
resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
5714-
integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=
5715-
57165683
lodash.defaults@^4.2.0:
57175684
version "4.2.0"
57185685
resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c"
@@ -5728,16 +5695,6 @@ lodash.flatten@^4.4.0:
57285695
resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f"
57295696
integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=
57305697

5731-
lodash.get@^4.4.2:
5732-
version "4.4.2"
5733-
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
5734-
integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=
5735-
5736-
lodash.isequal@^4.5.0:
5737-
version "4.5.0"
5738-
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
5739-
integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA=
5740-
57415698
lodash.ismatch@^4.4.0:
57425699
version "4.4.0"
57435700
resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37"
@@ -5753,11 +5710,6 @@ lodash.merge@^4.6.2:
57535710
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
57545711
integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==
57555712

5756-
lodash.set@^4.3.2:
5757-
version "4.3.2"
5758-
resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23"
5759-
integrity sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=
5760-
57615713
lodash.sortby@^4.7.0:
57625714
version "4.7.0"
57635715
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"

0 commit comments

Comments
 (0)
Please sign in to comment.