src/ui/prompt.js
// default value), show the problem to the user and return `null`.
default value), show the problem to the user and return `null`.
default value ) show the problem to the user and return ` null ` .
values() {
    let result = []
    for (let i = 0; i < this.command.params.length; i++) {
      let param = this.command.params[i], dom = this.fields[i]
      let type = this.paramTypes[param.type], value = type.read.call(this.pm, dom), bad
      if (param.validate)
        bad = param.validate(value)
      else if (!value && param.default == null)
        bad = "No default value available"
      if (bad) {
        if (type.reportInvalid)
          type.reportInvalid.call(this.pm, dom, bad)
        else
          this.reportInvalid(dom, bad)
        return null
      }
      result.push(value)
    }
    return result
  }
values ( ) { let result = [ ] for ( let i = 0 ; i < this . command . params . length ; i ++ ) { let param = this . command . params [ i ] , dom = this . fields [ i ] let type = this . paramTypes [ param . type ] , value = type . read . call ( this . pm , dom ) , bad if ( param . validate ) bad = param . validate ( value ) else if ( ! value && param . default == null ) bad = "No default value available" if ( bad ) { if ( type . reportInvalid ) type . reportInvalid . call ( this . pm , dom , bad ) else this . reportInvalid ( dom , bad ) return null } result . push ( value ) } return result }
default value), show the problem to the user and return `null`.
default value ) show the problem to the user and return ` null ` .