jspm_packages/npm/babel-core@5.8.38/lib/util.js
function regexify(val) {
  if (!val) return new RegExp(/.^/);

  if (Array.isArray(val)) val = new RegExp(val.map(_lodashStringEscapeRegExp2["default"]).join("|"), "i");

  if (_lodashLangIsString2["default"](val)) {
    // normalise path separators
    val = _slash2["default"](val);

    // remove starting wildcards or relative separator if present
    if (_lodashStringStartsWith2["default"](val, "./") || _lodashStringStartsWith2["default"](val, "*/")) val = val.slice(2);
    if (_lodashStringStartsWith2["default"](val, "**/")) val = val.slice(3);

    var regex = _minimatch2["default"].makeRe(val, { nocase: true });
    return new RegExp(regex.source.slice(1, -1), "i");
  }

  if (_lodashLangIsRegExp2["default"](val)) return val;

  throw new TypeError("illegal type for regexify");
}
function regexify(val) {
  if (!val) return new RegExp(/.^/);

  if (Array.isArray(val)) val = new RegExp(val.map(_lodashStringEscapeRegExp2["default"]).join("|"), "i");

  if (_lodashLangIsString2["default"](val)) {
    // normalise path separators
    val = _slash2["default"](val);

    // remove starting wildcards or relative separator if present
    if (_lodashStringStartsWith2["default"](val, "./") || _lodashStringStartsWith2["default"](val, "*/")) val = val.slice(2);
    if (_lodashStringStartsWith2["default"](val, "**/")) val = val.slice(3);

    var regex = _minimatch2["default"].makeRe(val, { nocase: true });
    return new RegExp(regex.source.slice(1, -1), "i");
  }

  if (_lodashLangIsRegExp2["default"](val)) return val;

  throw new TypeError("illegal type for regexify");
}
function regexify ( val ) { if ( ! val ) return new RegExp ( / .^ / ) ; if ( Array . isArray ( val ) ) val = new RegExp ( val . map ( _lodashStringEscapeRegExp2 [ "default" ] ) . join ( "|" ) , "i" ) ; if ( _lodashLangIsString2 [ "default" ] ( val ) ) { // normalise path separators val = _slash2 [ "default" ] ( val ) ; // remove starting wildcards or relative separator if present if ( _lodashStringStartsWith2 [ "default" ] ( val , "./" ) || _lodashStringStartsWith2 [ "default" ] ( val , "*/" ) ) val = val . slice ( 2 ) ; if ( _lodashStringStartsWith2 [ "default" ] ( val , "**/" ) ) val = val . slice ( 3 ) ; var regex = _minimatch2 [ "default" ] . makeRe ( val , { nocase : true } ) ; return new RegExp ( regex . source . slice ( 1 , - 1 ) , "i" ) ; } if ( _lodashLangIsRegExp2 [ "default" ] ( val ) ) return val ; throw new TypeError ( "illegal type for regexify" ) ; }
Create a RegExp from a string, array, or regexp.
Create a RegExp from a string array or regexp .