Skip to content

Commit

Permalink
Use backwards compatible fromPairs over fromEntries for node 10 support
Browse files Browse the repository at this point in the history
  • Loading branch information
thoov committed Mar 31, 2021
1 parent 5034500 commit 6b9f746
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/compat/src/v1-addon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import SynthesizeTemplateOnlyComponents from './synthesize-template-only-compone
import { isEmberAutoImportDynamic, isCompactReexports, isColocationPlugin } from './detect-babel-plugins';
import { ResolvedDep } from '@embroider/core/src/resolver';
import TemplateCompilerBroccoliPlugin from './template-compiler-broccoli-plugin';
import { fromPairs } from 'lodash';

const stockTreeNames = Object.freeze([
'addon',
Expand Down Expand Up @@ -797,9 +798,7 @@ export default class V1Addon {
return new ObserveTree(tree, (outputPath: string) => {
let dir = join(outputPath, localDir);
if (existsSync(dir)) {
files = Object.fromEntries(
walkSync(dir, { globs: ['**/*.js', '**/*.hbs'] }).map(f => [`./${f}`, `./${localDir}/${f}`])
);
files = fromPairs(walkSync(dir, { globs: ['**/*.js', '**/*.hbs'] }).map(f => [`./${f}`, `./${localDir}/${f}`]));
} else {
files = undefined;
}
Expand Down

0 comments on commit 6b9f746

Please sign in to comment.