Create a TypedString instance.
@param {object} config
@returns {TypedString}
@augments Typed
@constructor
969620
function TypedString (config) {
    const string = this;

    // validate min length
    if (config.hasOwnProperty('minLength') && (!util.isInteger(config.minLength) || config.minLength < 0)) {
        const message = util.propertyErrorMessage('minLength', config.minLength, 'Must be an integer that is greater than or equal to zero.');
        throw Error(message);
    }
    const minLength = config.hasOwnProperty('minLength') ? config.minLength : 0;

    // validate max length
    if (config.hasOwnProperty('maxLength') && (!util.isInteger(config.maxLength) || config.maxLength < minLength)) {
        const message = util.propertyErrorMessage('maxLength', config.maxLength, 'Must be an integer that is greater than or equal to the minLength.');
        throw Error(message);
    }

    // validate pattern
    if (config.hasOwnProperty('pattern') && !(config.pattern instanceof RegExp)) {
        const message = util.propertyErrorMessage('pattern', config.pattern, 'Must be a regular expression object.');
        throw Error(message);
    }

    // define properties
    Object.defineProperties(string, {

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

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

        pattern: {
            /**
             * @property
             * @name TypedString#pattern
             * @type {RegExp}
             */
            value: config.pattern,
            writable: false
        }

    });

    return string;
}
725698
function TypedOneOf (config) {
    const oneOf = this;

    // validate oneOf
    if (!config.hasOwnProperty('oneOf')) {
        throw Error('Invalid configuration. Missing required one-of property: oneOf. Must be an array of schema configurations.');
    }
    if (!Array.isArray(config.oneOf) || config.oneOf.filter(v => !v || typeof v !== 'object').length) {
        throw Error('Invalid configuration value for property: oneOf. Must be an array of schema configurations.');
    }

    // create each unique schema
    const hashes = {};
    const schemas = config.oneOf
        .map(item => FullyTyped(item))
        .filter(schema => {
            const hash = schema.hash();
            if (hashes[hash]) return false;
            hashes[hash] = true;
            return true;
        });

    // define properties
    Object.defineProperties(oneOf, {

        oneOf: {
            /**
             * @property
             * @name TypedOneOf#oneOf
             * @type {object}
             */
            value: schemas,
            writable: false
        }

    });

    return oneOf;
}
1016315
function normalizeConfig( config ) {
    var isObject = _.isObject( config ) && !Array.isArray( config );

    var defaultConfig = {
        baseUrl: '.' + _path.posix.sep, //String
        paths:   {}, //Object
        deps:    [], //Array
        shim:    {} //Object
    };

    if( isObject ) {
        config = _.defaults( config, defaultConfig );
    } else {
        return defaultConfig;
    }

    //Normalize baseUrl
    if( typeof config.baseUrl === 'string' ) {
        config.baseUrl = _path.posix.normalize( toPosix( config.baseUrl ) );
    } else {
        config.baseUrl = defaultConfig.baseUrl;
    }

    //Make sure paths is an object
    if( !_.isObject( config.paths ) || Array.isArray( config.paths ) ) {
        config.paths = defaultConfig.paths;
    }

    //Make sure shim is an object
    if( !_.isObject( config.shim ) || Array.isArray( config.shim ) ) {
        config.shim = defaultConfig.shim;
    }

    //Normalize deps
    config.deps = parseDeps( config.deps, config.paths );

    //Normalize shims
    config.shim = _.chain( config.shim ).mapValues( function( shim ) {
        if( Array.isArray( shim ) ) {
            return {
                deps: parseDeps( shim, config.paths )
            };
        } else if( _.isObject( shim ) && typeof shim.exports === 'string' ) {
            return {
                deps:    parseDeps( shim.deps, config.paths ),
                exports: shim.exports
            };
        }
    } ).omit( isNull ).value();

    //Normalize paths
    config.paths = _.chain( config.paths ).mapValues( function( p ) {
        if( typeof p === 'string' ) {
            return toPosix( p );
        }
    } ).omit( isNull ).value();

    return config;
}
1360935
function createTypeScriptLanguageService(options) {
    // Discover referenced files
    const FILES = discoverAndReadFiles(options);
    // Add fake usage files
    options.inlineEntryPoints.forEach((inlineEntryPoint, index) => {
        FILES[`inlineEntryPoint.${index}.ts`] = inlineEntryPoint;
    });
    // Add additional typings
    options.typings.forEach((typing) => {
        const filePath = path.join(options.sourcesRoot, typing);
        FILES[typing] = fs.readFileSync(filePath).toString();
    });
    // Resolve libs
    const RESOLVED_LIBS = {};
    options.libs.forEach((filename) => {
        const filepath = path.join(TYPESCRIPT_LIB_FOLDER, filename);
        RESOLVED_LIBS[`defaultLib:${filename}`] = fs.readFileSync(filepath).toString();
    });
    const compilerOptions = ts.convertCompilerOptionsFromJson(options.compilerOptions, options.sourcesRoot).options;
    const host = new TypeScriptLanguageServiceHost(RESOLVED_LIBS, FILES, compilerOptions);
    return ts.createLanguageService(host);
}
1361212
function toJSType(config) {
    //config.XXX is either undefined or string
  var falsyNotations = ['false', '0', undefined];
  if (!config.enabled || falsyNotations.indexOf(config.enabled.toLowerCase()) >= 0) {
    config.enabled = false;
  } else {
    config.enabled = true;
  }
  config.port = config.port ? parseInt(config.port, 10) : undefined;
  return config;
}
1253289
protected function fillType(KeyValueType $type, $config)
    {
        $parsed = $this->parseConfig($config);

        foreach ($parsed as $key=>$value) {
            $type[$key] = $parsed[$key];
        }

        return $type;
    }
1145228
function Config (config, defaultConfig) {
  validateConfig(config);
  deepAssign(this, defaultConfig || Config.defaults);

  if (config) {
    deepAssign(this, config);
  }
}
934821
function makeMoment(config) {
        var input = config._i,
            format = config._f;

        if (input === null || (format === undefined && input === '')) {
            return moment.invalid({nullInput: true});
        }

        if (typeof input === 'string') {
            config._i = input = getLangDefinition().preparse(input);
        }

        if (moment.isMoment(input)) {
            config = cloneMoment(input);

            config._d = new Date(+input._d);
        } else if (format) {
            if (isArray(format)) {
                makeDateFromStringAndArray(config);
            } else {
                makeDateFromStringAndFormat(config);
            }
        } else {
            makeDateFromInput(config);
        }

        return new Moment(config);
    }
329212
function typePaths(config) {
  var out = [
      "node_modules/@types",
  ];
  var paths = (config.compilerOptions && config.compilerOptions.paths) || {};
  Object.keys(paths).forEach( function eachEntry(k) {
    // paths may contain a /*, eliminate it
    paths[k].forEach(function eachPath(a) {
      var p = a.split("/\*")[0];
      if (out.indexOf(p) < 0) {
        out.push(p);
      }
    });
  });
  debug("type paths", out);
  return out;
}
200339
function initLogging (config) {
    // only create logger if custom logging enabled
    if (config.logger !== true) {
        return
    }
    // create new logger instance
    var logger = new winston.Logger()
    // add transport
    logger.add(winston.transports.Console, {
        formatter: winstonFormatter,
        level: 'info'
    });
    // make logger accessible
    config.logger = logger
    // override console.log function
    console.log = function () {
        logger.info.apply(logger, formatArgs(arguments))
    }
    // override console.info function
    console.info = function () {
        logger.info.apply(logger, formatArgs(arguments))
    }
    // override console.warn function
    console.warn = function () {
        logger.warn.apply(logger, formatArgs(arguments))
    }
    // override console.error function
    console.error = function () {
        logger.error.apply(logger, formatArgs(arguments))
    }
    // override console.debug function
    console.debug = function () {
        logger.debug.apply(logger, formatArgs(arguments))
    }
}
974518
function(terminalConfig) {

   	var klass = WireIt.terminalClassFromXtype(terminalConfig.xtype);

      // Instanciate the terminal
      var term = new klass(this.el, terminalConfig, this);
   
      // Add the terminal to the list
      this.terminals.push( term );
   
      // Event listeners
      term.eventAddWire.subscribe(this.onAddWire, this, true);
      term.eventRemoveWire.subscribe(this.onRemoveWire, this, true);
   
      return term;
   }
568387
function setConfig(config) {
  let oldConfig = getConfig();  // to check if the file exists.
  if (!oldConfig) return false;
  if (typeof config !== 'object' || !config) return false;
  let configData = '';
  try {
    configData = JSON.stringify(config, null, 1);
  } catch (e) {
    console.warn(`thorin-env: failed to serialize configuration`, e);
    return false;
  }
  try {
    fs.writeFileSync(PERSIST_FILE, configData, {encoding: 'utf8'});
  } catch (e) {
    console.warn(`thorin-env: failed to persist new config in .thorin file`);
    console.debug(e);
    return false;
  }
  return true;
}
385252
function Builder (config) {
  if (!(config instanceof Config)) {
    config = new Config(config)
  }
  this.config = config
  // TODO: check for root.val
  if (!this.config.native.root) {
    // TODO: simplify this set
    this.config.native.set({
      root: {
        val: process.cwd()
      }
    })
  }
}
505168
function Group(config) {
  if (!(this instanceof Group)) {
    return new Group(config);
  }

  Base.call(this, config);
  this.is('Group');
  this.use(utils.option());
  this.use(utils.plugin());
  this.init();
}
507930
function Logger(config) {
    var self    = this;
    var config  = config || {};
    var options = config.options || {};
    var debug   = options.debug || false;
    var dev     = options.dev || false;
    var logging = config.logging || {};

    details = options.debugDetails || false;
    ignored = options.debugIgnore || [];

    if (typeof logging !== 'object') { logging = {}; }

    var enabled = typeof logging.enabled !== 'undefined' ? logging.enabled : false;
    var rewrite = typeof logging.rewrite !== 'undefined' ? logging.rewrite : true;
    var chat    = typeof logging.chat !== 'undefined' ? logging.chat : false;

    timestamp = typeof logging.timestamp !== 'undefined' ? logging.timestamp : true;

    this.options = {
        stream: process.stdout,
        wstream: null,
        level: 'raw'
    };

    if (debug && details) { this.options.level = 'chat'; }
    if (dev) { this.options.level = 'dev'; }
    if (!debug) { this.options.level = 'crash'; }

    if (enabled) {
        ensureExists('./logs', function(err) {
            if (!err) {
                var flag = rewrite ? 'w' : 'a';
                var stream = filesystem.createWriteStream('./logs/status.log', { flags: flag });
                self.options.wstream = stream;
                if (chat) { self.options.level = 'chat'; }
            }
        });
    }

    this.templates = {
        chat:  '[:timestamp] \x1b[35mchat\x1b[39m   - :message',
        action:  '[:timestamp] \x1b[35maction\x1b[39m - :message',
        dev:   '\x1b[90m  :message\x1b[39m',
        raw:   '[:timestamp] \x1b[36mraw\x1b[39m    - :message',
        event: '[:timestamp] \x1b[32mevent\x1b[39m  - :message',
        info:  '[:timestamp] \x1b[33minfo\x1b[39m   - :message',
        error: '[:timestamp] \x1b[31merror\x1b[39m  - :message',
        crash: '[:timestamp] \x1b[31merror\x1b[39m  - :message',
        inspect: true
    };
}
405690
function (config) {
      // Extend our config to out instance:
      if (config) {
        Thulium.Util.extend(this, config);
      }

      // Check for template value.
      if (!this.template) {
        console.warn('Warning, no template passed.');
      }

      this._initRegex();

      // return instance.
      return this;
    }
749746
function(config) {

      var x, style;

      // save config
      hashedit.config = config;

      // set path
      if (config.path != null) {
        hashedit.path = config.path;
      }

      // set login
      if (config.login != null) {
        hashedit.loginUrl = config.login;
      }

      // set grid
      if (config.grid != null) {
        hashedit.grid = config.grid;
      }

      // create container
      hashedit.current.container = document.createElement('div');
      hashedit.current.container.setAttribute('class', 'hashedit-container');
      hashedit.current.container.setAttribute('id', 'hashedit-container');

      // set stylesheet
      if (config.stylesheet !== null) {
        hashedit.stylesheet = config.stylesheet;
      }

      // set url
      if (config.url !== null) {
        hashedit.url = config.url;
      }

      // append container to body
      document.body.appendChild(hashedit.current.container);

      // create style
      style = document.createElement('style');

      // append scoped stylesheet to container
      for (x = 0; x < hashedit.stylesheet.length; x++) {
        style.innerHTML += '@import url(' + hashedit.stylesheet[x] + ');';
      }

      hashedit.current.container.appendChild(style);

      // check auth
      if (config.demo === true) {

        hashedit.demo = true;

        // init hashedit
        hashedit.setActive();
        hashedit.setupView();
        hashedit.setupSortable();
        hashedit.setupBlocks();
        hashedit.setContentEditable();
        hashedit.setupContentEditableEvents();
        hashedit.setupMenu(config.path);
        hashedit.setupToast();
        hashedit.createMenu(config.path);
        hashedit.loadHTML(config.path);
        hashedit.translate();

      }
      else {

        // set default auth
        var obj = {
          credentials: 'include'
        }

        // enable token based auth
        if(hashedit.useToken) {

          // set obj headers
          obj = {
            headers: {}
          };

          obj.headers[hashedit.authHeader] = hashedit.authHeaderPrefix + ' ' + localStorage.getItem(hashedit.tokenName);
        }

        // check auth
        fetch(hashedit.authUrl, obj)
          .then(function(response) {

            if (response.status !== 200) {
              hashedit.showAuth();
            }
            else {

              // init hashedit
              hashedit.setActive();
              hashedit.setupView();
              hashedit.setupSortable();
              hashedit.setupBlocks();
              hashedit.setContentEditable();
              hashedit.setupContentEditableEvents();
              hashedit.setupMenu(config.path);
              hashedit.setupToast();
              hashedit.createMenu(config.path);
              hashedit.loadHTML(config.path);
              hashedit.translate();

              // setup loaded event
              var event = new Event('hashedit.loaded');
              document.dispatchEvent(event);

            }

          });
      }

    }