Skip to content

Commit

Permalink
refactor: remove usage of arguments (yargs#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyfarrell authored and bcoe committed May 5, 2019
1 parent c0cd851 commit f184308
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions index.js
Expand Up @@ -33,9 +33,7 @@ function parse (args, opts) {
var notFlagsArgv = notFlagsOption ? '--' : '_'
var newAliases = {}
// allow a i18n handler to be passed in, default to a fake one (util.format).
var __ = opts.__ || function (str) {
return util.format.apply(util, Array.prototype.slice.call(arguments))
}
var __ = opts.__ || util.format
var error = null
var flags = {
aliases: {},
Expand Down Expand Up @@ -687,8 +685,8 @@ function parse (args, opts) {
}

// extend the aliases list with inferred aliases.
function extendAliases () {
Array.prototype.slice.call(arguments).forEach(function (obj) {
function extendAliases (...args) {
args.forEach(function (obj) {
Object.keys(obj || {}).forEach(function (key) {
// short-circuit if we've already added a key
// to the aliases array, for example it might
Expand Down

0 comments on commit f184308

Please sign in to comment.