Skip to content

Commit

Permalink
refactor(core): use Object.entries when mapping makeTargets in the v5…
Browse files Browse the repository at this point in the history
… importer
  • Loading branch information
malept committed Jul 16, 2019
1 parent 5fb8e55 commit 745e768
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/api/core/src/util/upgrade-forge-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import {
import path from 'path';
import { siblingDep } from '../api/init-scripts/init-npm';

type MakeTargets = { string: string[] };

function mapMakeTargets(forge5Config: any): Map<string, ForgePlatform[]> {
const makeTargets = new Map<string, ForgePlatform[]>();
if (forge5Config.makeTargets) {
// TODO: Use object.entries when dropping Node 6
for (const platform of Object.keys(forge5Config.makeTargets)) {
for (const target of forge5Config.makeTargets[platform]) {
for (const [platform, targets] of Object.entries(forge5Config.makeTargets as MakeTargets)) {
for (const target of targets) {
let platforms = makeTargets.get(target);
if (platforms === undefined) {
platforms = [];
Expand Down

0 comments on commit 745e768

Please sign in to comment.