Esprima based minifier transform for Browserify.
Options are per the {@link https://github.com/estools/escodegen/wiki/API|escodegen} format.
@param {object} opt An options hash
964431
function esmangleify(opt) {

  // options is mostly the escodegen format
  var format = {
    renumber   : true,
    hexadecimal: true,
    escapeless : true,
    compact    : true,
    semicolons : false,
    parentheses: false
  }

  // fail silently allows us to process json (and other non js) files that make it through the transform process
  //  alternatively you could implement a options.filter
  var options = merge(format, {
    failSilently: true
  }, opt);

  // transform
  return esprimaTools.createTransform(updater, options);
}
188878
function formatOpts(opts) {
  opts = opts || {};
  // key
  opts.key = opts.key || 'koa:sess';

  // back-compat maxage
  if (!('maxAge' in opts)) opts.maxAge = opts.maxage;

  // defaults
  if (opts.overwrite == null) opts.overwrite = true;
  if (opts.httpOnly == null) opts.httpOnly = true;
  if (opts.signed == null) opts.signed = true;

  debug('session options %j', opts);

  // setup encoding/decoding
  if (typeof opts.encode !== 'function') {
    opts.encode = util.encode;
  }
  if (typeof opts.decode !== 'function') {
    opts.decode = util.decode;
  }

  const store = opts.store;
  if (store) {
    assert(is.function(store.get), 'store.get must be function');
    assert(is.function(store.set), 'store.set must be function');
    assert(is.function(store.destroy), 'store.destroy must be function');
  }

  const ContextStore = opts.ContextStore;
  if (ContextStore) {
    assert(is.class(ContextStore), 'ContextStore must be a class');
    assert(is.function(ContextStore.prototype.get), 'ContextStore.prototype.get must be function');
    assert(is.function(ContextStore.prototype.set), 'ContextStore.prototype.set must be function');
    assert(is.function(ContextStore.prototype.destroy), 'ContextStore.prototype.destroy must be function');
  }

  if (!opts.genid) {
    if (opts.prefix) opts.genid = () => opts.prefix + uid.sync(24);
    else opts.genid = () => uid.sync(24);
  }

  return opts;
}
940163
function (opt) {

			var fs = require('fs');
			var util = require('util');
			var fmt = util.format;
			var recbuild_t = require('aureooms-node-recursive-build');
			var UglifyJS = require('uglify-js');
			var babel = require('babel-core');
			var extend = require('node.extend');
			var path = require('path');

			var dflt = {
				fullname: undefined,
				name: undefined,
				src: undefined,
				out: undefined,
				base: 0,
				rec: false,
				flat: true,
				babel: false
			};

			opt = extend({}, dflt, opt);

			var namespace = opt.name.replace(/-/g, '');

			var recbuild = recbuild_t({
				fullname: opt.fullname,
				name: namespace,
				rec: opt.rec,
				flat: opt.flat
			});

			if (!fs.existsSync(opt.out)) fs.mkdirSync(opt.out);

			var fd,
			    base = fmt('%s/%s%%s', opt.out, opt.name),
			    concat = path.normalize(fmt(base, '.js')),
			    min = path.normalize(fmt(base, '.min.js')),
			    map = path.normalize(fmt(base, '.js.map'));

			var fhandle = function (f) {
				var raw = fs.readFileSync(f);
				fs.writeSync(fd, raw.toString());
				fs.writeSync(fd, '\n');
			};

			var rhandle = function (raw) {
				fs.writeSync(fd, raw);
				fs.writeSync(fd, '\n');
			};

			fd = fs.openSync(concat, 'w');
			recbuild(opt.src, namespace, -opt.base, fhandle, rhandle);
			fs.closeSync(fd);

			if (opt.babel) {

				if (opt.babel === true) opt.babel = {};

				var es5 = babel.transformFileSync(concat, opt.babel);

				fd = fs.openSync(concat, 'w');

				fs.writeSync(fd, es5.code);

				fs.closeSync(fd);
			}

			var minified = UglifyJS.minify(concat, { outSourceMap: map });

			fs.writeFileSync(min, minified.code);
			fs.writeFileSync(map, minified.map);
		}
613766
function parseOptions(opts) {
    opts = opts || {};
    if (toString.call(opts) === '[object String]') {
        opts = {
            directory: opts
        };
    }

    opts.cwd = opts.cwd || process.cwd();

    log.verbosity = toString.call(opts.verbosity) === '[object Number]' ? opts.verbosity : DEFAULT_VERBOSITY;
    delete (opts.verbosity);

    cmd = opts.cmd || DEFAULT_CMD;
    delete (opts.cmd);

    // enable bower prompting but ignore the actual prompt if interactive == false
    enablePrompt = opts.interactive || DEFAULT_INTERACTIVE;
    opts.interactive = true;

    if (!opts.directory) {
        opts.directory = getDirectoryFromBowerRc(opts.cwd) || DEFAULT_DIRECTORY;
    }

    return opts;
}
1316676
function styledJsxOptions(opts) {
  if (!opts) {
    return {};
  }

  if (!Array.isArray(opts.plugins)) {
    return opts;
  }

  opts.plugins = opts.plugins.map(plugin => {
    if (Array.isArray(plugin)) {
      const [ name, options ] = plugin;
      return [ require.resolve(name), options ];
    }

    return require.resolve(plugin);
  });

  return opts;
}
1094992
function (opt) {
    if (typeof opt !== "object" || opt === null) {
        opt = {};
    }
    if (typeof opt.tag !== "string") {
        opt.tag = null;
    }
    if (typeof opt.encoding !== "string") {
        opt.encoding = "utf8";
    }

    //Extends the readable stream
    stream.Readable.call(this, {encoding: opt.encoding});

    this._tag = (typeof opt.tag === "string") ? opt.tag.trim() : null;
    this._level = labels.length;
    this._disabled = false;

    //Default message format
    this._format = function (tag, label, text) {
        let list = [];
        if (tag) {
            //Add the tag if it is provided
            list.push("[" + tag + "]");
        }
        list.push("[" + timestamp("YYYY-MM-DD hh:mm:ss") + "]");
        list.push("[" + label.toUpperCase() + "]");
        list.push(text.trim());
        return list.join(" ");
    };

    return this;
}
1298017
function getTransform(options) {
  if (typeof options === 'string' || options instanceof String) {
    return options
  }

  if (typeof options === 'object' && options.engine) {
    return options.engine
  }

  throw new Error('options.engine not found.')
}
896623
function Decoder (opts) {
  if (!(this instanceof Decoder)) {
    return new Decoder(opts);
  }
  Transform.call(this, opts);
  var ret;

  ret = binding.mpg123_new(opts ? opts.decoder : null);
  if (Buffer.isBuffer(ret)) {
    this.mh = ret;
  } else {
    throw new Error('mpg123_new() failed: ' + ret);
  }

  ret = binding.mpg123_open_feed(this.mh);
  if (MPG123_OK != ret) {
    throw new Error('mpg123_open_feed() failed: ' + ret);
  }
  debug('created new Decoder instance');
}
1054054
function opt(options, name, defaultValue){
    return options && options[name]!==undefined ? options[name] : defaultValue;
}
74232
function flexiRequire(browserify, options) {
	hookFilter(browserify, options);

	browserify._bpack.hasExports = true; // NOTE : need require from other bundle file

	if (!options.noreset) browserify.on('reset', reset);
	reset();

	var cached = new Cached(browserify);
	var mcached = new mutils.Cached(browserify);

	function reset() {
		var stream = through.obj(
			function transform(row, enc, next) {
				this.push(row);
				next();
			},
			function flush(done) {
				var self = this;
				collectModules(cached, mcached, options,
					function (new_requires) {
						for (var key in new_requires) {
							self.push(new_requires[key]);
						}
						self.push(null);
						done();
					});
			});
		browserify.pipeline.get('record').push(stream);
	}

	return browserify;
}
219341
function Courier(opts) {
  stream.Transform.call(this, { objectMode: true });

  this.options = merge(Object.create(Courier.DEFAULTS), opts || {});
}
752906
function Registry(opt_options) {
  if (!(this instanceof Registry)) {
    return new Registry(opt_options);
  }
  opt_options = opt_options || {};

  this.breakOnError = opt_options.breakOnError || false;
  this.depth = opt_options.depth || 10;

  // regex to match "$schema.*"
  this._match = /"\$id:[a-z0-9_-]*"/ig;
  // regex to escape strings for usage as regex
  this._escape = /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;

  this.schemas = {};
}
796642
function(opt) {
        console.log("\n\n############ENGINE CONFIGURATION OPTIONS############\n");
        console.dir(opt);
        console.log("\n####################################################\n");
        if (!opt.hasOwnProperty('engine')) throw ("Please specify a scheduler engine");
        if (opt.engine === "sge")
            engine = sgeLib;
        else if (opt.engine === "slurm")
            engine = slurmLib;
        else if (opt.engine === "emulator") {
            engine = emulatorLib;
            emulator = true;
        }
        if (opt.engine != "emulator") {
            if (!opt.hasOwnProperty('binaries')) throw "You must specify scheduler engine binaries";
        }
        engine.configure(opt.binaries, jobsArray);
        console.log("Engine configured is " + engine.type());
    }
596183
function Options(opts) {

  //### Private properties

  var custfilt = [],
      varset   = {__FILE: '', $__FILE: '""'}

  //### Public Properties

  this.header1    = _defaults.header1
  this.headers    = _defaults.headers
  this.indent     = _defaults.indent
  this.eolType    = _defaults.eolType
  this.emptyLines = _defaults.emptyLines
  this.comments   = _defaults.comments
  this.filter     = _defaults.filter

  this.emitError  = procError     // error "handler"

  //### Public Methods

  this.invalid = function (msg, v) {
    this.emitError('Invalid ' + msg + ' ' + (v != null ? '"' + v + '"' : v))
  }

  this.getVars = function () {
    return varset
  }

  this.setFile = function (file) {
    varset.$__FILE = JSON.stringify(varset.__FILE = file)
  }

  this.def = function (s) {
    var m = s.match(RE_VARPAIR)

    if (m) {
      var k = m[1],
          v = m[2].trim()

      if (!RE_VARNAME.test(k))
        this.invalid('symbol name', k)
      else
        varset[k] = !v ? 1 :
          _fixValue(evalExpr(v, varset, this.emitError))
    }
    else
      this.invalid('symbol name or declaration', s) // only when starts with '='
  }

  this.undef = function (s) {
    var def = s.match(RE_VARNAME)

    if (def)
      delete varset[def[1]]
    else
      this.invalid('symbol name', s)
  }

  this.passFilter = function (str) {
    var i, f, filts

    for (i = 0; i < custfilt.length; ++i) {
      /* istanbul ignore else */
      if (custfilt[i].test(str)) return true
    }
    filts = this.filter
    if (filts === 'all')
      filts = Object.keys(_filters)
    for (i = 0; i < filts.length; ++i) {
      f = _filters[filts[i]]
      if (f.test(str)) return true
    }
    return false
  }

  this.merge = function (opt) {
    if (opt)
      merge.call(this, opt)
    return this
  }

  return this.merge(opts)

  //### Private methods

  // prepare a value for inclussion in the set of variables
  function _fixValue(v) {
    switch (typeof v) {
      case 'number':      // typeof NaN is 'number'
      case 'boolean':
      case 'undefined':
        break
      default:
        // date value returns 'new Date(NaN)' for null dates, ok
        v = v instanceof RegExp ? '' + v :
            v instanceof Date ? '(new Date(' + (+v) + '))' : // eslint-disable-line no-extra-parens
            v == null ? v : JSON.stringify(v)
        break
    }
    return v
  }

  // returns an array as-is or created from a delimited string
  function _split(v) {
    return Array.isArray(v) ? v : v.split(',')
  }

  // Enable filters for comments, 'all' enable all filters
  function _setFilter(filt) {
    filt = filt.trim()
    if (filt === 'all')
      this.filter = filt
    else if (filt in _filters) {
      if (this.filter !== 'all' && this.filter.indexOf(filt) < 0)
        this.filter.push(filt)
    }
    else this.invalid('filter', filt)
  }

  // Creates a custom filter
  function _createFilter(res) {
    for (var i = 0; i < res.length; ++i) {
      var f = res[i]

      if (f instanceof RegExp)
        custfilt.push(f)
      else {
        //console.log('--- creating regex with `' + str + '`')
        try {
          f = new RegExp(f)
          custfilt.push(f)
        }
        catch (e) {
          f = null
        }
        if (!f) this.invalid('custom filter', res[i])
      }
    }
  }

  function _formatHeader(str) {
    return !str ? '' :
      ('' + str)
      .replace(/\r\n?/g, '\n')
      .replace(/\^{1,2}/g, function (c) { return c[1] || '\n' })
  }

  function _setVars(set) {
    for (var k in set) {
      if (RE_VARNAME.test(k))
        varset[k] = _fixValue(set[k])
      else
        this.invalid('symbol name', k)
    }
  }

  /* eslint-disable guard-for-in, complexity */
  function merge(opt) {
    var k, v

    for (k in opt) {
      v = opt[k]

      switch (k) {
        case 'varset':
          _setVars.call(this, v)
          break
        case 'define':
        case 'set':
          _split(v).forEach(this.def, this)
          break
        case 'undef':
        case 'unset':
          _split(v).forEach(this.undef, this)
          break
        case 'filter':
          _split(v).forEach(_setFilter, this)
          break
        case 'customFilter':
          _createFilter(Array.isArray(v) ? v : [v])
          break
        case 'header1':
        case 'headers':
          this[k] = _formatHeader(v)
          break
        case 'emptyLines':
          this[k] = v | 0
          break
        case 'eolType':
          if (/^(?:win|mac|unix)$/.test(v))
            this[k] = v
          else
            this.invalid(k, v)
          break
        case 'comments':
          if (/^(?:all|none|filter)$/.test(v))
            this[k] = v
          else
            this.invalid(k + ' value', v)
          break
        case 'indent':
          if (/^\d+[ts]?/.test(v))
            this[k] = v
          else if (!v)
            this[k] = ''
          else
            this.invalid(k, v)
          break
        default:
          break
      }
      //else
      //  console.log('Ignoring option ' + k)
    }
  }
}
243802
function localExport(opt) {
    var ind = _.reGet(/\d/)(opt.chart.renderTo);
    _.assign(opt, {
      'exporting': {
        'buttons': {
          'contextButton': {
            'y': -10,
            'menuItems': [{
              'text': 'Save as PNG',
              onclick: function() {
                this.createCanvas(opt.title, 'png', ind);
              },
              'separator': false
            }, {
              'text': 'Save as JPEG',
              onclick: function() {
                this.createCanvas(opt.title, 'jpeg', ind);
              },
              'separator': false
            }]
          }
        }
      }
    })
    return opt;
  }
211689
function MetaCharsetReplacerStream(options) {
    options = options || {};
    this.encoding = options.encoding = 'utf8'; // this is the *output* encoding
    options.decodeStrings = false; // don't turn my strings back into a buffer!
    Transform.call(this, options);
}
469454
function handleCipherSuccess(opts, err) {
  console.log(chalk.green(
    '\nSuccess: ' + opts.input + ' → ' + opts.output + '\n'
  ));
}