Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/yargs/lib/argsert.js')
-rw-r--r--node_modules/yargs/lib/argsert.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/node_modules/yargs/lib/argsert.js b/node_modules/yargs/lib/argsert.js
index ed1d59871..f310b4e74 100644
--- a/node_modules/yargs/lib/argsert.js
+++ b/node_modules/yargs/lib/argsert.js
@@ -1,16 +1,18 @@
'use strict'
+
+// hoisted due to circular dependency on command.
+module.exports = argsert
const command = require('./command')()
const YError = require('./yerror')
const positionName = ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']
-
-module.exports = function argsert (expected, callerArguments, length) {
+function argsert (expected, callerArguments, length) {
// TODO: should this eventually raise an exception.
try {
// 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