Skip to content

Commit

Permalink
Use ramda toPairs instead of Object.entries
Browse files Browse the repository at this point in the history
which is not supported in node v10
  • Loading branch information
lo1tuma committed Aug 25, 2020
1 parent 23229db commit f9e34ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion benchmarks/runtime.bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
const { expect } = require('chai');
const { Linter } = require('eslint');
const times = require('ramda/src/times');
const toPairs = require('ramda/src/toPairs');
const fromPairs = require('ramda/src/fromPairs');
const { runBenchmark, cpuSpeed } = require('./measure');
const mochaPlugin = require('../');

Expand All @@ -14,7 +16,7 @@ function lintManyFilesWithAllRecommendedRules({ numberOfFiles }) {
linter.defineRules(mochaPlugin.rules);

const config = {
rules: Object.fromEntries(Object.entries(recommendedRules).map(([ ruleName, ruleSettings ]) => {
rules: fromPairs(toPairs(recommendedRules).map(([ ruleName, ruleSettings ]) => {
const [ , ruleNameWithoutPrefix ] = ruleName.split('/');

return [ ruleNameWithoutPrefix, ruleSettings ];
Expand Down

0 comments on commit f9e34ce

Please sign in to comment.