Skip to content

Commit

Permalink
use .indexOf instead of .includes for node v4 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
75lb committed Mar 31, 2019
1 parent b9860f4 commit e28c9b0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ function isValue (arg) {
}

function isExecArg (arg) {
return ['--eval', '-e'].includes(arg) || arg.startsWith('--eval=')
return ['--eval', '-e'].indexOf(arg) > -1 || arg.startsWith('--eval=')
}

/**
Expand Down
2 changes: 1 addition & 1 deletion dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ function isValue (arg) {
}

function isExecArg (arg) {
return ['--eval', '-e'].includes(arg) || arg.startsWith('--eval=')
return ['--eval', '-e'].indexOf(arg) > -1 || arg.startsWith('--eval=')
}

/**
Expand Down
2 changes: 1 addition & 1 deletion dist/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ function isValue (arg) {
}

function isExecArg (arg) {
return ['--eval', '-e'].includes(arg) || arg.startsWith('--eval=')
return ['--eval', '-e'].indexOf(arg) > -1 || arg.startsWith('--eval=')
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/argv-tools.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function isValue (arg) {
}

function isExecArg (arg) {
return ['--eval', '-e'].includes(arg) || arg.startsWith('--eval=')
return ['--eval', '-e'].indexOf(arg) > -1 || arg.startsWith('--eval=')
}

export {
Expand Down

0 comments on commit e28c9b0

Please sign in to comment.