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
Родитель 45e4c02ec6
Коммит fab9432277
2 изменённых файлов: 2 добавлений и 5 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -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) {