Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 2x 2x 2x 2x 2x 53x 53x 53x 53x 2x | const {addRemainingOptsAndPosArgs} = require('./addRemainingOptsAndPosArgs') const {assignOptsAndPosArgs} = require('./assignOptsAndPosArgs') const {verifyCommand} = require('./verifyCommand') const {pipe} = require('../../pipe') const toOpts = (opt = {}) => { const {errs: errs2, opt: opt2} = verifyCommand(opt) const defaultCommand = { key: 'default', opts: [] } const opt3 = opt2 || defaultCommand return ({errs = [], argv = []} = {errs: [], argv: []}) => pipe( assignOptsAndPosArgs(opt3), addRemainingOptsAndPosArgs(opt3) )({errs: [...errs, ...errs2], argv}) } module.exports = { toOpts } |