Skip to content

Commit

Permalink
Remove more code
Browse files Browse the repository at this point in the history
  • Loading branch information
tbleckert committed Jun 29, 2020
1 parent 6cb2bc1 commit edf35ca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
7 changes: 1 addition & 6 deletions dist/cjs/highlightReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@ exports["default"] = highlightReducer;
function highlightReducer(highlighted, value) {
var key = value.key,
options = value.options;

if (!options || !key) {
return highlighted;
}

var newHighlighted = key === 'ArrowDown' ? highlighted + 1 : highlighted - 1;
var max = options.length - 1;
var newHighlighted = key === 'ArrowDown' ? highlighted + 1 : highlighted - 1;

if (newHighlighted < 0) {
newHighlighted = max;
Expand Down
7 changes: 1 addition & 6 deletions dist/esm/highlightReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@ export default function highlightReducer(highlighted, value) {
key,
options
} = value;

if (!options || !key) {
return highlighted;
}

let newHighlighted = key === 'ArrowDown' ? highlighted + 1 : highlighted - 1;
const max = options.length - 1;
let newHighlighted = key === 'ArrowDown' ? highlighted + 1 : highlighted - 1;

if (newHighlighted < 0) {
newHighlighted = max;
Expand Down
7 changes: 1 addition & 6 deletions src/highlightReducer.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
export default function highlightReducer(highlighted, value) {
const { key, options } = value;

if (!options || !key) {
return highlighted;
}

let newHighlighted = (key === 'ArrowDown') ? highlighted + 1 : highlighted - 1;
const max = options.length - 1;
let newHighlighted = (key === 'ArrowDown') ? highlighted + 1 : highlighted - 1;

if (newHighlighted < 0) {
newHighlighted = max;
Expand Down

1 comment on commit edf35ca

@vercel
Copy link

@vercel vercel bot commented on edf35ca Jun 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.