targets.js
function validateListFromOptions (opts, name) {
    if (opts.all) return Array.from(supported[name].values())

    let list = opts[name]
    if (!list) {
      if (name === 'arch') {
        list = hostArch()
      } else {
        list = process[name]
      }
    } else if (list === 'all') {
      return Array.from(supported[name].values())
    }

    if (!Array.isArray(list)) {
      if (typeof list === 'string') {
        list = list.split(/,\s*/)
      } else {
        return unsupportedListOption(name, list, supported[name])
      }
    }

    const officialElectronPackages = usingOfficialElectronPackages(opts)

    for (let value of list) {
      if (officialElectronPackages && !supported[name].has(value)) {
        return unsupportedListOption(name, value, supported[name])
      }
    }

    return list
  }
function validateListFromOptions (opts, name) {
    if (opts.all) return Array.from(supported[name].values())

    let list = opts[name]
    if (!list) {
      if (name === 'arch') {
        list = hostArch()
      } else {
        list = process[name]
      }
    } else if (list === 'all') {
      return Array.from(supported[name].values())
    }

    if (!Array.isArray(list)) {
      if (typeof list === 'string') {
        list = list.split(/,\s*/)
      } else {
        return unsupportedListOption(name, list, supported[name])
      }
    }

    const officialElectronPackages = usingOfficialElectronPackages(opts)

    for (let value of list) {
      if (officialElectronPackages && !supported[name].has(value)) {
        return unsupportedListOption(name, value, supported[name])
      }
    }

    return list
  }
function validateListFromOptions ( opts , name ) { if ( opts . all ) return Array . from ( supported [ name ] . values ( ) ) let list = opts [ name ] if ( ! list ) { if ( name === 'arch' ) { list = hostArch ( ) } else { list = process [ name ] } } else if ( list === 'all' ) { return Array . from ( supported [ name ] . values ( ) ) } if ( ! Array . isArray ( list ) ) { if ( typeof list === 'string' ) { list = list . split ( / ,\s* / ) } else { return unsupportedListOption ( name , list , supported [ name ] ) } } const officialElectronPackages = usingOfficialElectronPackages ( opts ) for ( let value of list ) { if ( officialElectronPackages && ! supported [ name ] . has ( value ) ) { return unsupportedListOption ( name , value , supported [ name ] ) } } return list }
Validates list of architectures or platforms. Returns a normalized array if successful, or throws an Error.
Validates list of architectures or platforms . Returns a normalized array if successful or throws an Error .