Bug 1737971 - Remove lodash flatten/flattenDeep usage r=nchevobbe

Depends on D135081

Differential Revision: https://phabricator.services.mozilla.com/D135092
This commit is contained in:
Joaquín Serna 2022-01-05 08:58:46 +00:00
parent 45e4c02ec6
commit fab9432277
2 changed files with 2 additions and 5 deletions

View File

@ -7,8 +7,6 @@
* @module actions/sources
*/
import { flatten } from "lodash";
import { insertSourceActors } from "../../actions/source-actors";
import { makeSourceId } from "../../client/firefox/create";
import { toggleBlackBox } from "./blackbox";
@ -54,7 +52,7 @@ function loadSourceMaps(cx, sources) {
await sourceQueue.flush();
return flatten(sourceList);
return sourceList.flat();
} catch (error) {
if (!(error instanceof ContextError)) {
throw error;

View File

@ -3,7 +3,6 @@
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
import { createParentMap } from "./utils";
import flattenDeep from "lodash/flattenDeep";
function findSourceItem(sourceTree, source) {
function _traverse(subtree) {
@ -35,7 +34,7 @@ export function findSourceTreeNodes(sourceTree, path) {
}
const result = _traverse(sourceTree);
return Array.isArray(result) ? flattenDeep(result) : result;
return Array.isArray(result) ? result.flat(Infinity) : result;
}
function getAncestors(sourceTree, item) {