Skip to content

Commit

Permalink
chore: update deps (#1296)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Feb 15, 2019
1 parent 16c5d25 commit 51876e6
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion lib/argsert.js
Expand Up @@ -12,7 +12,7 @@ function argsert (expected, callerArguments, length) {
// preface the argument description with "cmd", so
// that we can run it through yargs' command parser.
let position = 0
let parsed = {demanded: [], optional: []}
let parsed = { demanded: [], optional: [] }
if (typeof expected === 'object') {
length = callerArguments
callerArguments = expected
Expand Down
2 changes: 1 addition & 1 deletion lib/command.js
Expand Up @@ -2,7 +2,7 @@

const inspect = require('util').inspect
const isPromise = require('./is-promise')
const {applyMiddleware, commandMiddlewareFactory} = require('./middleware')
const { applyMiddleware, commandMiddlewareFactory } = require('./middleware')
const path = require('path')
const Parser = require('yargs-parser')

Expand Down
10 changes: 5 additions & 5 deletions lib/usage.js
Expand Up @@ -181,7 +181,7 @@ module.exports = function usage (yargs, y18n) {
usages.forEach((usage) => {
ui.div(`${usage[0].replace(/\$0/g, base$0)}`)
if (usage[1]) {
ui.div({text: `${usage[1]}`, padding: [1, 0, 0, 0]})
ui.div({ text: `${usage[1]}`, padding: [1, 0, 0, 0] })
}
})
ui.div()
Expand Down Expand Up @@ -217,15 +217,15 @@ module.exports = function usage (yargs, y18n) {
padding: [0, 2, 0, 2],
width: maxWidth(commands, theWrap, `${base$0}${parentCommands}`) + 4
},
{text: command[1]}
{ text: command[1] }
)
const hints = []
if (command[2]) hints.push(`[${__('default:').slice(0, -1)}]`) // TODO hacking around i18n here
if (command[3] && command[3].length) {
hints.push(`[${__('aliases:')} ${command[3].join(', ')}]`)
}
if (hints.length) {
ui.div({text: hints.join(' '), padding: [0, 0, 0, 2], align: 'right'})
ui.div({ text: hints.join(' '), padding: [0, 0, 0, 2], align: 'right' })
} else {
ui.div()
}
Expand Down Expand Up @@ -301,11 +301,11 @@ module.exports = function usage (yargs, y18n) {
].filter(Boolean).join(' ')

ui.span(
{text: kswitch, padding: [0, 2, 0, 2], width: maxWidth(switches, theWrap) + 4},
{ text: kswitch, padding: [0, 2, 0, 2], width: maxWidth(switches, theWrap) + 4 },
desc
)

if (extra) ui.div({text: extra, padding: [0, 0, 0, 2], align: 'right'})
if (extra) ui.div({ text: extra, padding: [0, 0, 0, 2], align: 'right' })
else ui.div()
})

Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -41,8 +41,8 @@
"mocha": "^5.2.0",
"nyc": "^13.2.0",
"rimraf": "^2.6.3",
"standard": "^11.0.1",
"standard-version": "^4.4.0",
"standard": "^12.0.1",
"standard-version": "^5.0.0",
"which": "^1.3.1",
"yargs-test-extends": "^1.0.1"
},
Expand Down
2 changes: 1 addition & 1 deletion test/argsert.js
Expand Up @@ -33,7 +33,7 @@ describe('Argsert', () => {
argsert('[object]', [].slice.call(arguments))
}

foo({foo: 'bar'})
foo({ foo: 'bar' })
})

o.warnings.length.should.equal(0)
Expand Down
10 changes: 5 additions & 5 deletions test/completion.js
Expand Up @@ -121,8 +121,8 @@ describe('Completion', () => {
it('avoids repeating already included options', () => {
const r = checkUsage(() => yargs(['./completion', '--get-yargs-completions', './completion', '--foo', '--'])
.options({
foo: {describe: 'foo option'},
bar: {describe: 'bar option'}
foo: { describe: 'foo option' },
bar: { describe: 'bar option' }
})
.completion()
.argv
Expand All @@ -135,8 +135,8 @@ describe('Completion', () => {
it('avoids repeating options whose aliases are already included', () => {
const r = checkUsage(() => yargs(['./completion', '--get-yargs-completions', './completion', '--f', '--'])
.options({
foo: {describe: 'foo option', alias: 'f'},
bar: {describe: 'bar option'}
foo: { describe: 'foo option', alias: 'f' },
bar: { describe: 'bar option' }
})
.completion()
.argv
Expand Down Expand Up @@ -448,7 +448,7 @@ describe('Completion', () => {
const r = checkUsage(() => {
try {
return yargs(['./completion', '--get-yargs-completions', '--'])
.option('foo', {'describe': 'bar'})
.option('foo', { 'describe': 'bar' })
.completion()
.strict()
.argv
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/configured-bin.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
var argv = require('./yargs/index.js')
.parserConfiguration({'dot-notation': true})
.parserConfiguration({ 'dot-notation': true })
.help('help')
.version()
.argv
Expand Down
4 changes: 2 additions & 2 deletions test/middleware.js
@@ -1,8 +1,8 @@
'use strict'
/* global describe, it, beforeEach, afterEach */

const {expect} = require('chai')
const {globalMiddlewareFactory} = require('../lib/middleware')
const { expect } = require('chai')
const { globalMiddlewareFactory } = require('../lib/middleware')
let yargs
require('chai').should()

Expand Down
6 changes: 3 additions & 3 deletions test/usage.js
Expand Up @@ -1987,7 +1987,7 @@ describe('usage tests', () => {
.help('h')
.default('a', [])
.default('a2', [3])
.default('o', {a: '33'})
.default('o', { a: '33' })
.wrap(null)
.parse()
)
Expand Down Expand Up @@ -2604,7 +2604,7 @@ describe('usage tests', () => {
.command(['list [pattern]', 'ls', '*'], 'List key-value pairs for pattern', {}, noop)
.command('get <key>', 'Get value for key', {}, noop)
.command('set <key> [value]', 'Set value for key', {}, noop)
.parserConfiguration({'sort-commands': true})
.parserConfiguration({ 'sort-commands': true })
.parse()
)

Expand Down Expand Up @@ -2683,7 +2683,7 @@ describe('usage tests', () => {

it('should display options that have been configured', () => {
const r = checkUsage(() => yargs('--help')
.command('* [pattern]', 'List key-value pairs for pattern', {uuid: {required: true}}, noop)
.command('* [pattern]', 'List key-value pairs for pattern', { uuid: { required: true } }, noop)
.command('get <key>', 'Get value for key', {}, noop)
.command('set <key> [value]', 'Set value for key', {}, noop)
.parse()
Expand Down
20 changes: 10 additions & 10 deletions test/validation.js
Expand Up @@ -349,7 +349,7 @@ describe('validation tests', () => {
yargs()
.command('foo <y>')
.strict()
.parse('foo 99', {x: 33}, (err, argv, output) => {
.parse('foo 99', { x: 33 }, (err, argv, output) => {
expect(err).to.equal(null)
expect(output).to.equal('')
argv.y.should.equal(99)
Expand All @@ -370,7 +370,7 @@ describe('validation tests', () => {
})
})
.strict()
.parse('request get --y=22', {x: 33}, (err, argv, output) => {
.parse('request get --y=22', { x: 33 }, (err, argv, output) => {
expect(err).to.equal(null)
expect(output).to.equal('')
argv.y.should.equal(22)
Expand Down Expand Up @@ -450,7 +450,7 @@ describe('validation tests', () => {
describe('requiresArg', () => {
it('fails when a required argument value of type number is missing', (done) => {
yargs()
.option('w', {type: 'number', requiresArg: true})
.option('w', { type: 'number', requiresArg: true })
.parse('-w', (err, argv, output) => {
expect(err).to.not.equal(undefined)
expect(err).to.have.property('message', 'Not enough arguments following: w')
Expand All @@ -460,7 +460,7 @@ describe('validation tests', () => {

it('fails when a required argument value of type string is missing', (done) => {
yargs()
.option('w', {type: 'string', requiresArg: true})
.option('w', { type: 'string', requiresArg: true })
.parse('-w', (err, argv, output) => {
expect(err).to.not.equal(undefined)
expect(err).to.have.property('message', 'Not enough arguments following: w')
Expand All @@ -470,7 +470,7 @@ describe('validation tests', () => {

it('fails when a required argument value of type boolean is missing', (done) => {
yargs()
.option('w', {type: 'boolean', requiresArg: true})
.option('w', { type: 'boolean', requiresArg: true })
.parse('-w', (err, argv, output) => {
expect(err).to.not.equal(undefined)
expect(err).to.have.property('message', 'Not enough arguments following: w')
Expand All @@ -480,7 +480,7 @@ describe('validation tests', () => {

it('fails when a required argument value of type array is missing', (done) => {
yargs()
.option('w', {type: 'array', requiresArg: true})
.option('w', { type: 'array', requiresArg: true })
.parse('-w', (err, argv, output) => {
expect(err).to.not.equal(undefined)
expect(err).to.have.property('message', 'Not enough arguments following: w')
Expand All @@ -491,7 +491,7 @@ describe('validation tests', () => {
// see: https://github.com/yargs/yargs/issues/1041
it('does not fail if argument with required value is not provided', (done) => {
yargs()
.option('w', {type: 'number', requiresArg: true})
.option('w', { type: 'number', requiresArg: true })
.command('woo')
.parse('', (err, argv, output) => {
expect(err).to.equal(null)
Expand All @@ -501,7 +501,7 @@ describe('validation tests', () => {

it('does not fail if argument with required value is not provided to subcommand', (done) => {
yargs()
.option('w', {type: 'number', requiresArg: true})
.option('w', { type: 'number', requiresArg: true })
.command('woo')
.parse('woo', (err, argv, output) => {
expect(err).to.equal(null)
Expand Down Expand Up @@ -812,7 +812,7 @@ describe('validation tests', () => {
it('does not fail for hidden options', () => {
const args = yargs('--foo hey')
.strict()
.option('foo', {boolean: true, describe: false})
.option('foo', { boolean: true, describe: false })
.fail((msg) => {
expect.fail()
})
Expand All @@ -823,7 +823,7 @@ describe('validation tests', () => {
it('does not fail if an alias is provided, rather than option itself', () => {
const args = yargs('--cat hey')
.strict()
.option('foo', {boolean: true, describe: false})
.option('foo', { boolean: true, describe: false })
.alias('foo', 'bar')
.alias('bar', 'cat')
.fail((msg) => {
Expand Down
20 changes: 10 additions & 10 deletions test/yargs.js
Expand Up @@ -256,7 +256,7 @@ describe('yargs dsl tests', () => {
string: [],
alias: {},
default: {},
key: {help: true, version: true},
key: { help: true, version: true },
narg: {},
defaultDescription: {},
choices: {},
Expand Down Expand Up @@ -337,7 +337,7 @@ describe('yargs dsl tests', () => {
return done()
},
[function (argv) {
return {hello: 'world'}
return { hello: 'world' }
}]
)
.exitProcess(false) // defaults to true.
Expand Down Expand Up @@ -1032,7 +1032,7 @@ describe('yargs dsl tests', () => {
// see: https://github.com/yargs/yargs/issues/671
it('does not fail if context object has cyclical reference', () => {
let argv = null
const context = {state: 'grumpy but rich'}
const context = { state: 'grumpy but rich' }
context.res = context
yargs()
.command('batman <api-token>', 'batman command', noop, (_argv) => {
Expand All @@ -1046,15 +1046,15 @@ describe('yargs dsl tests', () => {
})

it('allows nested sub-commands to be invoked multiple times', () => {
const context = {counter: 0}
const context = { counter: 0 }

checkOutput(() => {
const parser = yargs()
.commandDir('fixtures/cmddir')

parser.parse('dream within-a-dream --what', {context}, (_err, argv, _output) => {})
parser.parse('dream within-a-dream --what', {context}, (_err, argv, _output) => {})
parser.parse('dream within-a-dream --what', {context}, (_err, argv, _output) => {})
parser.parse('dream within-a-dream --what', { context }, (_err, argv, _output) => {})
parser.parse('dream within-a-dream --what', { context }, (_err, argv, _output) => {})
parser.parse('dream within-a-dream --what', { context }, (_err, argv, _output) => {})
})

context.counter.should.equal(3)
Expand Down Expand Up @@ -1249,7 +1249,7 @@ describe('yargs dsl tests', () => {

it('allows to pass a configuration object', () => {
const argv = yargs
.config({foo: 1, bar: 2})
.config({ foo: 1, bar: 2 })
.parse()

argv.foo.should.equal(1)
Expand All @@ -1272,7 +1272,7 @@ describe('yargs dsl tests', () => {

it('protects against circular extended configurations', () => {
expect(() => {
yargs.config({extends: './test/fixtures/extends/circular_1.json'})
yargs.config({ extends: './test/fixtures/extends/circular_1.json' })
}).to.throw(YError)
})

Expand Down Expand Up @@ -1615,7 +1615,7 @@ describe('yargs dsl tests', () => {
describe('parserConfiguration', () => {
it('overrides the default parser configuration ', () => {
const argv = yargs('--foo.bar 1 --no-baz 2')
.parserConfiguration({'boolean-negation': false, 'dot-notation': false})
.parserConfiguration({ 'boolean-negation': false, 'dot-notation': false })
.parse()
expect(argv['foo.bar']).to.equal(1)
argv.noBaz.should.equal(2)
Expand Down
2 changes: 1 addition & 1 deletion yargs.js
Expand Up @@ -11,7 +11,7 @@ const Y18n = require('y18n')
const objFilter = require('./lib/obj-filter')
const setBlocking = require('set-blocking')
const applyExtends = require('./lib/apply-extends')
const {globalMiddlewareFactory} = require('./lib/middleware')
const { globalMiddlewareFactory } = require('./lib/middleware')
const YError = require('./lib/yerror')

exports = module.exports = Yargs
Expand Down

0 comments on commit 51876e6

Please sign in to comment.