转换配置为标准option
@param config
@return {Array}
169785
function convertConfig(config) {
    let {colors, prev = '', output, src = 'css/rsuite.min.css'} =config;
    return Object.keys(colors).map(key => {
        return {
            baseColor: colors[key],
            src,
            dist: Path.join(output, `${prev}${key}${Path.extname(src)}`)
        }
    });
}
1279668
function getOption(opts) {
  return {
    tag: 'option',
    attrs: {
      disabled: opts.disabled,
      value: opts.value
    },
    children: opts.text,
    key: opts.value
  };
}
1323398
public function enabled( $config = array())
    {
        $config = new ObjectConfigJson($config);
        $config->append(array(
            'name'      => 'enabled',
            'attribs'   => array(),
            'deselect'  => true,
        ))->append(array(
            'selected'  => $config->{$config->name}
        ));

        $translator = $this->getObject('translator');
        $options    = array();

        $options[] = $this->option(array('label' => $translator->translate( 'Enabled' ) , 'value' => 1 ));
        $options[] = $this->option(array('label' => $translator->translate( 'Disabled' ), 'value' => 0 ));

        //Add the options to the config object
        $config->options = $options;

        return $this->optionlist($config);
    }
183812
function (config) {
        config = config || {};
        this.api_key = config.api_key;
        this.host = config.host || undefined;
        this.api_version = config.api_version || undefined;
        this.dev_mode = config.dev_mode || false;
        return this;
    }
471924
function getConfigFromCommandLine(argv) {
	const options = {};
	forEach(argv, (value, key) => {
		if (key.startsWith('config:')) {
			options[key.replace(/^config:/, '')] = value;
		}
	});
	return options;
}
318368
protected function getOptionsFromConfig(Config $config)
    {
        $options = $this->options;

        if ($visibility = $config->get('visibility')) {
            // For local reference
            $options['visibility'] = $visibility;
            // For external reference
            $options['ACL'] = $visibility === AdapterInterface::VISIBILITY_PUBLIC ? 'public-read' : 'private';
        }

        if ($mimetype = $config->get('mimetype')) {
            // For local reference
            $options['mimetype'] = $mimetype;
            // For external reference
            $options['ContentType'] = $mimetype;
        }

        foreach (static::$metaOptions as $option) {
            if ( ! $config->has($option)) {
                continue;
            }
            $options[$option] = $config->get($option);
        }

        return $options;
    }
620126
function getConfigOptions(opts) {
    opts = formatOptions(opts);
    _.forEach(config, function(value, key) {
      opts[key] = opts[key] || value;
    });
    opts.headers = opts.headers || {};

    return opts;
  }
47616
public function parseConfiguration($config)
    {
        if (is_string($config)) {
            $config = ['url' => $config];
        }

        $url = $config['url'] ?? null;

        $config = Arr::except($config, 'url');

        if (! $url) {
            return $config;
        }

        $parsedUrl = $this->parseUrl($url);

        return array_merge(
            $config,
            $this->getPrimaryOptions($parsedUrl),
            $this->getQueryOptions($parsedUrl)
        );
    }
749394
public function saveOptions($config = null)
    {
        if ($config === null) {
            return $this->getConfig('saveOptions');
        }

        return $this->setConfig('saveOptions', $config);
    }
719951
public function options( $config = array() )
    {
        $config = new ObjectConfig($config);
        $config->append(array(
            'entity'    => array(),
            'name'      => 'id',
            'value'     => 'id',
            'label'     => 'id',
            'disabled'  => null,
            'attribs'   => array(),
        ));
        $options = array();
        foreach($config->entity as $entity)
        {
            $option = array(
                'id'       => isset($entity->{$config->name}) ? $entity->{$config->name} : null,
                'name'     => $config->name,
                'disabled' => $config->disabled,
                'attribs'  => ObjectConfig::unbox($config->attribs),
                'value'    => $entity->{$config->value},
                'label'    => $entity->{$config->label},
            );
            if($config->entity instanceof \RecursiveIteratorIterator) {
                $option['level'] = $config->entity->getDepth() + 1;
            }
            $options[] = $this->option($option);
        }
        return $options;
    }
394150
function optionString(options) {
    return Object.keys(options).map(function (key) {
        var value = options[key];
        if (value === null) {
            return '-' + key;
        } else if (typeof value === 'number') {
            value += '';
        } else if (typeof value === 'string') {
            value = '"' + value.replace(/"/g, '\\"') + '"';
        }
        return '-' + key + '=' + value.replace(/`/g, '');
    }).join(' ');
}
1351163
function setConfig (options) {
  Object.keys(options).forEach((option) => {
    if (config[option] !== undefined) {
      config[option] = options[option]
    }
  })
}
953982
function getParserConfiguration(target, config) {
  target = target || this;
  config = config || {alias: {}, flags: [], options: []};
  var k, arg, key
    , conf  = this.configure();
  var no = /^\[?no\]?/, nor = /(\[no-?\]-?)/;
  for(k in target._options) {
    arg = target._options[k];

    // misconfigured option, not a valid instance
    if(typeof arg.isArgument !== 'function') continue;

    if(!arg.isFlag() && !arg.isOption()) {
      continue;
    }
    var names = arg.names().slice(0);
    names.forEach(function(nm, index, arr) {
      arr[index] = nm.replace(nor, '');
    })
    key = arg.key();
    //console.log('key: %s', key);
    if(no.test(key)) {
      // this works around an issue with args such as --noop
      // without the charAt test the id is *op*
      // ensuring the first character is uppercase is akin to
      // checking the declaration was '[no]-'
      if(/^[A-Z]$/.test(key.charAt(2))) {
        key = key.replace(no, '');
        key = key.charAt(0).toLowerCase() + key.slice(1);
      }
      //console.log('final key: %s', key);
    }
    config.alias[names.join(' ')] = key;
    if(arg.isFlag()) {
      config.flags = config.flags.concat(names);
    }else{
      config.options = config.options.concat(names);
    }
  }

  // TODO: sometimes child options have the same keys
  // TODO: as top-level options, these duplicates can be removed
  for(k in target._commands) {
    getParserConfiguration.call(this, target._commands[k], config);
  }

  if(conf.variables && conf.variables.prefix) {
    config.vars = {variables: conf.variables.prefix};
  }

  return config;
}
818352
private String getConfigUrlHtml(Config config) {

        return "<br/>点击<a href='http://" + applicationPropertyConfig.getDomain() + "/modifyFile.html?configId=" +
                config.getId() + "'> 这里 </a> 进入查看<br/>";
    }
746707
protected function getOptionsFromConfig(Config $config)
    {
        $options = [];

        if ($config->has('visibility')) {
            switch (true) {
                case $config->get('visibility') === AdapterInterface::VISIBILITY_PUBLIC:
                    $options['predefinedAcl'] = static::GCS_VISIBILITY_PUBLIC_READ;
                    break;
                case $config->get('visibility') === AdapterInterface::VISIBILITY_PRIVATE:
                default:
                    $options['predefinedAcl'] = static::GCS_VISIBILITY_PROJECT_PRIVATE;
                    break;
            }
        }

        return $options;
    }
320776
public function optionlist($config = array())
    {
        $translator = $this->getObject('translator');

        $config = new ObjectConfigJson($config);
        $config->append(array(
            'prompt'    => '- '.$translator->translate('Select').' -',
            'deselect'  => false,
            'options'   => array(),
            'select2'   => true,
            'attribs'   => array(),
        ));

        if ($config->deselect && !$config->attribs->multiple)
        {
            $deselect = $this->option(array('value' => '', 'label' => $config->prompt));
            $options  = $config->options->toArray();
            array_unshift($options, $deselect);
            $config->options = $options;
        }

        if ($config->attribs->multiple && $config->name && substr($config->name, -2) !== '[]') {
            $config->name .= '[]';
        }

        $html = '';

        if ($config->select2)
        {
            if (!$config->name) {
                $config->attribs->append(array(
                    'id' => 'select2-element-'.mt_rand(1000, 100000)
                ));
            }
            
            if ($config->deselect) {
                $config->attribs->append(array(
                    'data-placeholder' => $config->prompt
                ));
            }

            $config->append(array(
                'select2_options' => array(
                    'element' => $config->attribs->id ? '#'.$config->attribs->id : 'select[name=\"'.$config->name.'\"]',
                    'options' => array(
                        'allowClear'  => $config->deselect
                    )

                )
            ));

            $html .= $this->createHelper('behavior')->select2($config->select2_options);
        }

        $html .= parent::optionlist($config);

        return $html;
    }
484883
function getOptions(opts) {
  var options = {};
  for (var opt in defaultOptions) {
    options[opt] = opts && _util.has(opts, opt) ? opts[opt] : defaultOptions[opt];
  }if (options.allowReserved == null) options.allowReserved = options.ecmaVersion < 5;

  if (_util.isArray(options.onToken)) {
    (function () {
      var tokens = options.onToken;
      options.onToken = function (token) {
        return tokens.push(token);
      };
    })();
  }
  if (_util.isArray(options.onComment)) options.onComment = pushComment(options, options.onComment);

  return options;
}