Create a TypedArray instance.
@param {object} config
@returns {TypedArray}
@augments Typed
@constructor
444
function TypedArray (config) {
    const array = this;

    // validate min items
    if (config.hasOwnProperty('minItems') && (!util.isInteger(config.minItems) || config.minItems < 0)) {
        throw Error('Invalid configuration value for property: minItems. Must be an integer that is greater than or equal to zero. Received: ' + config.minItems);
    }
    const minItems = config.hasOwnProperty('minItems') ? config.minItems : 0;

    // validate max items
    if (config.hasOwnProperty('maxItems') && (!util.isInteger(config.maxItems) || config.maxItems < minItems)) {
        throw Error('Invalid configuration value for property: maxItems. Must be an integer that is greater than or equal to the minItems. Received: ' + config.maxItems);
    }

    // validate schema
    if (config.hasOwnProperty('schema')) config.schema = FullyTyped(config.schema);

    // define properties
    Object.defineProperties(array, {

        maxItems: {
            /**
             * @property
             * @name TypedArray#maxItems
             * @type {number}
             */
            value: Math.round(config.maxItems),
            writable: false
        },

        minItems: {
            /**
             * @property
             * @name TypedArray#minItems
             * @type {number}
             */
            value: Math.round(config.minItems),
            writable: false
        },

        schema: {
            /**
             * @property
             * @name TypedArray#schema
             * @type {object}
             */
            value: config.schema,
            writable: false
        },

        uniqueItems: {
            /**
             * @property
             * @name TypedArray#uniqueItems
             * @type {boolean}
             */
            value: !!config.uniqueItems,
            writable: false
        }

    });

    return array;
}
358476
public static function instance($config = [])
    {
        if (null === self::$instance) {
            self::$instance = new static($config);
        }

        return self::$instance;
    }
709391
function TypedNumber (config) {
    const number = this;

    // validate min
    if (config.hasOwnProperty('min') && !util.isNumber(config.min)) {
        const message = util.propertyErrorMessage('min', config.min, 'Must be a number.');
        throw Error(message);
    }

    // validate max
    if (config.hasOwnProperty('max') && !util.isNumber(config.max)) {
        const message = util.propertyErrorMessage('max', config.max, 'Must be a number.');
        throw Error(message);
    }

    // validate max is greater than min
    if (config.hasOwnProperty('max') && config.hasOwnProperty('min') && config.min > config.max) {
        const message = util.propertyErrorMessage('max', config.max, 'Must be a number that is less than the minimum: ' + config.min + '.');
        throw Error(message);
    }

    // define properties
    Object.defineProperties(number, {

        exclusiveMax: {
            /**
             * @property
             * @name TypedNumber#exclusiveMax
             * @type {boolean}
             */
            value: !!config.exclusiveMax,
            writable: false
        },

        exclusiveMin: {
            /**
             * @property
             * @name TypedNumber#exclusiveMin
             * @type {boolean}
             */
            value: !!config.exclusiveMin,
            writable: false
        },

        integer: {
            /**
             * @property
             * @name TypedNumber#integer
             * @type {boolean}
             */
            value: !!config.integer,
            writable: false
        },

        max: {
            /**
             * @property
             * @name TypedNumber#max
             * @type {number}
             */
            value: Number(config.max),
            writable: false
        },

        min: {
            /**
             * @property
             * @name TypedNumber#min
             * @type {number}
             */
            value: Number(config.min),
            writable: false
        }

    });

    return number;
}
1024332
public static Object toArray( JSONArray jsonArray, JsonConfig jsonConfig ) {
      Class objectClass = jsonConfig.getRootClass();
      Map classMap = jsonConfig.getClassMap();

      if( jsonArray.size() == 0 ){
         return Array.newInstance( objectClass == null ? Object.class : objectClass, 0 );
      }

      int[] dimensions = JSONArray.getDimensions( jsonArray );
      Object array = Array.newInstance( objectClass == null ? Object.class : objectClass,
            dimensions );
      int size = jsonArray.size();
      for( int i = 0; i < size; i++ ){
         Object value = jsonArray.get( i );
         if( JSONUtils.isNull( value ) ){
            Array.set( array, i, null );
         }else{
            Class type = value.getClass();
            if( JSONArray.class.isAssignableFrom( type ) ){
               Array.set( array, i, toArray( (JSONArray) value, objectClass, classMap ) );
            }else if( String.class.isAssignableFrom( type )
                  || Boolean.class.isAssignableFrom( type )
                  || Character.class.isAssignableFrom( type )
                  || JSONFunction.class.isAssignableFrom( type ) ){
               if( objectClass != null && !objectClass.isAssignableFrom( type ) ){
                  value = JSONUtils.getMorpherRegistry()
                        .morph( objectClass, value );
               }
               Array.set( array, i, value );
            }else if( JSONUtils.isNumber( type ) ){
               if( objectClass != null
                     && (Byte.class.isAssignableFrom( objectClass ) || Byte.TYPE.isAssignableFrom( objectClass )) ){
                  Array.set( array, i, Byte.valueOf( String.valueOf( value ) ) );
               }else if( objectClass != null
                     && (Short.class.isAssignableFrom( objectClass ) || Short.TYPE.isAssignableFrom( objectClass )) ){
                  Array.set( array, i, Short.valueOf( String.valueOf( value ) ) );
               }else{
                  Array.set( array, i, value );
               }
            }else{
               if( objectClass != null ){
                  JsonConfig jsc = jsonConfig.copy();
                  jsc.setRootClass( objectClass );
                  jsc.setClassMap( classMap );
                  Array.set( array, i, JSONObject.toBean( (JSONObject) value, jsc ) );
               }else{
                  Array.set( array, i, JSONObject.toBean( (JSONObject) value ) );
               }
            }
         }
      }
      return array;
   }
196499
public function bootstrap($config = array())
    {
        $config = new ObjectConfigJson($config);
        $config->append(array(
            'debug' => \Kodekit::getInstance()->isDebug(),
            'css'   => true,
            'javascript' => false
        ));

        $html = '';

        if ($config->javascript && !static::isLoaded('bootstrap-javascript'))
        {
            $html .= $this->jquery($config);
            $html .= '<ktml:script src="assets://js/'.($config->debug ? 'build/' : 'min/').'bootstrap.js" />';

            static::setLoaded('bootstrap-javascript');
        }

        if ($config->css && !static::isLoaded('bootstrap-css'))
        {
            $html .= '<ktml:style src="assets://css/bootstrap.css" />';

            static::setLoaded('bootstrap-css');
        }

        return $html;
    }
563848
function configFromStringAndArray(config) {
    var tempConfig,
        bestMoment,

        scoreToBeat,
        i,
        currentScore;

    if (config._f.length === 0) {
        getParsingFlags(config).invalidFormat = true;
        config._d = new Date(NaN);
        return;
    }

    for (i = 0; i < config._f.length; i++) {
        currentScore = 0;
        tempConfig = copyConfig({}, config);
        if (config._useUTC != null) {
            tempConfig._useUTC = config._useUTC;
        }
        tempConfig._f = config._f[i];
        configFromStringAndFormat(tempConfig);

        if (!isValid(tempConfig)) {
            continue;
        }

        // if there is any input that was not parsed add a penalty for that format
        currentScore += getParsingFlags(tempConfig).charsLeftOver;

        //or tokens
        currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;

        getParsingFlags(tempConfig).score = currentScore;

        if (scoreToBeat == null || currentScore < scoreToBeat) {
            scoreToBeat = currentScore;
            bestMoment = tempConfig;
        }
    }

    extend(config, bestMoment || tempConfig);
}
104962
static public function createObject($type, array $config = [])
	{
		if (is_string($type)) {
			return static::container()->get($type, $config);
		} elseif (is_array($type) && isset($type['class'])) {
			$class = $type['class'];
			unset($type['class']);
			if ($config) $type = array_merge($type, $config); 
			return static::container()->get($class, $type);
		} elseif (is_callable($type, false)) {
			return call_user_func($type, $config);
		} elseif (is_object($type)) {
			return $type;
		} elseif (is_array($type)) {
			throw new InvalidConfigException('object configuration must be an array containing a "class" element.');
		} else {
			throw new InvalidConfigException("Unsupported configuration type: " . gettype($type));
		}
	}
191004
public function checkArrayOfType(array $config)
    {
        if (\count($config) === 1 && isset($config[0])) {
            $type = $this->createType($config[0]);
            return $this->createArrayOfType($type);
        }
        return null;
    }
146975
public function createFromArray($config)
    {
        if (isset($config['viewConfig'])) {
            $this->viewBuilder()->createFromArray($config['viewConfig']);
            unset($config['viewConfig']);
        }

        foreach ($config as $property => $value) {
            $this->{$property} = $value;
        }

        return $this;
    }
357055
public function javascript($config = array())
    {
        return $this->getTemplate()->helper('behavior.bootstrap', array(
            'debug' => JFactory::getApplication()->getCfg('debug'),
            'css' => false,
            'javascript' => true
        ));
    }
463476
function formatConfig(config) {
  const result = {
    appenders: {
      out: { type: 'console' }
    },
    categories: {
      default: {
        appenders: ['out'],
        level: 'info'
      }
    }
  }
  for (const appender of config.appenders) {
    result.appenders[appender.type] = Object.assign({}, appender)
    ;(result.categories[appender.category] ||
      (result.categories[appender.category] = {
        appenders: [],
        level: 'info'
      }))['appenders'].push(appender.type)
  }
  return result
}
243625
function initUserConfig ( config ) {

    var parsedConfig = {};

    if ( !config ) {
        return;
    }

    config = config.split( ";" );

    $.each( config, function ( index, item ) {

        item = item.split( ":" );
        parsedConfig[ item[ 0 ] ] = item[ 1 ];

    } );

    setUserConfig( parsedConfig );

}
1316145
function init(config){
    var logger = new LogglyLogger(config);
    logger.validateConfig();

    logger.config = config;
    logger.client = loggly.createClient({
        token: config.token,
        subdomain: config.application,
        auth: config.auth,

        // TOOD: pushing more tags onto this array, or not using them, should be configurable
        tags: [
            config.domain,
            config.machine
        ]

        // Loggly docs say it uses json stringify if json:true
        // JSON stringify does not handle Errors or circulare references well
        // Logger.createEntry handles them well
    });
    return logger;
}
1285725
public function prepareType($config)
    {
        $config['type'] = $config['inputTypes']['string'];

        if (isset($config['inputTypes'][$config['inputType']])) {
            $config['type'] = $config['inputTypes'][$config['inputType']];
        }

        return $config;
    }
876782
function (config) {
    if (!config) {
        config = {};
    }
    this.subject = config.subject;
    this.value = config.value;
    this.operator = (config.operator) ? config.operator : Operators.EQUALS;
    return this;
}
855137
public static function create(array $config = [])
    {
        $container = new Container();

        foreach (self::$booleanSetters as $key => $method) {
            if (isset($config[$key])) {
                $container->$method((bool) $config[$key]);
            }
        }

        foreach (self::$arraySetters as $key => $method) {
            if (isset($config[$key]) && is_array($config[$key])) {
                foreach ($config[$key] as $name => $value) {
                    $container->$method($name, $value);
                }
            }
        }

        if (isset($config[Container::CONFIG_ENTRIES]) && is_array($config[Container::CONFIG_ENTRIES])) {
            self::createEntries($container, $config[Container::CONFIG_ENTRIES]);
        }

        return $container;
    }
76053
public function createFromConfig(array $config)
    {
        $class = key($config);
        $this->checkMappingIsValid($class);

        return new ClassArgumentObject($this->mapping[$class]->getInstance(), $config[$class]);
    }