Skip to content

Commit

Permalink
Use for-of loops in preference of lodash _.forEach
Browse files Browse the repository at this point in the history
Change-type: patch
  • Loading branch information
Page- committed Jan 9, 2025
1 parent c479508 commit cef6808
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Gruntfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const serverConfigs = {
server: serverConfig,
};

_.forEach(serverConfigs, (config) => {
for (const config of Object.values(serverConfigs)) {
config.optimization = {
minimizer: [
new TerserPlugin({
Expand All @@ -32,7 +32,7 @@ _.forEach(serverConfigs, (config) => {
}),
],
};
});
}

export = (grunt: typeof Grunt) => {
grunt.initConfig({
Expand Down Expand Up @@ -96,8 +96,8 @@ export = (grunt: typeof Grunt) => {
},

rename: (() => {
const renames: _.Dictionary<{ src: string; dest: string }> = {};
_.forEach(serverConfigs, (_config, task) => {
const renames: Record<string, { src: string; dest: string }> = {};
for (const task of Object.keys(serverConfigs)) {
renames[task] = {
src: 'out/pine.js',
dest: `out/pine-${task}-<%= grunt.option('version') %>.js`,
Expand All @@ -106,7 +106,7 @@ export = (grunt: typeof Grunt) => {
src: 'out/pine.js.map',
dest: `out/pine-${task}-<%= grunt.option('version') %>.js.map`,
};
});
}
return renames;
})(),

Expand Down

0 comments on commit cef6808

Please sign in to comment.