保誠-保戶業務員媒合平台
HelenHuang
2022-06-09 ab4e8129d5c94ff96e6c85d0d2b66a04a052b4e5
PAMapp/node_modules/ignore/legacy.js
@@ -35,8 +35,13 @@
  });
};
var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; // Sanitize the range of a regular expression
var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
var RETURN_FALSE = function RETURN_FALSE() {
  return false;
}; // Sanitize the range of a regular expression
// The cases are complicated, see test cases for details
var sanitizeRange = function sanitizeRange(range) {
  return range.replace(REGEX_REGEXP_RANGE, function (match, from, to) {
@@ -205,20 +210,17 @@
var regexCache = Object.create(null); // @param {pattern}
var makeRegex = function makeRegex(pattern, negative, ignorecase) {
  var r = regexCache[pattern];
var makeRegex = function makeRegex(pattern, ignoreCase) {
  var source = regexCache[pattern];
  if (r) {
    return r;
  } // const replacers = negative
  //   ? NEGATIVE_REPLACERS
  //   : POSITIVE_REPLACERS
  if (!source) {
    source = REPLACERS.reduce(function (prev, current) {
      return prev.replace(current[0], current[1].bind(pattern));
    }, pattern);
    regexCache[pattern] = source;
  }
  var source = REPLACERS.reduce(function (prev, current) {
    return prev.replace(current[0], current[1].bind(pattern));
  }, pattern);
  return regexCache[pattern] = ignorecase ? new RegExp(source, 'i') : new RegExp(source);
  return ignoreCase ? new RegExp(source, 'i') : new RegExp(source);
};
var isString = function isString(subject) {
@@ -244,7 +246,7 @@
  this.regex = regex;
};
var createRule = function createRule(pattern, ignorecase) {
var createRule = function createRule(pattern, ignoreCase) {
  var origin = pattern;
  var negative = false; // > An optional prefix "!" which negates the pattern;
@@ -258,7 +260,7 @@
  .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!') // > Put a backslash ("\") in front of the first hash for patterns that
  // >   begin with a hash.
  .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#');
  var regex = makeRegex(pattern, negative, ignorecase);
  var regex = makeRegex(pattern, ignoreCase);
  return new IgnoreRule(origin, pattern, negative, regex);
};
@@ -299,13 +301,18 @@
  function Ignore() {
    var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
        _ref$ignorecase = _ref.ignorecase,
        ignorecase = _ref$ignorecase === void 0 ? true : _ref$ignorecase;
        ignorecase = _ref$ignorecase === void 0 ? true : _ref$ignorecase,
        _ref$ignoreCase = _ref.ignoreCase,
        ignoreCase = _ref$ignoreCase === void 0 ? ignorecase : _ref$ignoreCase,
        _ref$allowRelativePat = _ref.allowRelativePaths,
        allowRelativePaths = _ref$allowRelativePat === void 0 ? false : _ref$allowRelativePat;
    _classCallCheck(this, Ignore);
    this._rules = [];
    this._ignorecase = ignorecase;
    define(this, KEY_IGNORE, true);
    this._rules = [];
    this._ignoreCase = ignoreCase;
    this._allowRelativePaths = allowRelativePaths;
    this._initCache();
  }
@@ -327,7 +334,7 @@
      }
      if (checkPattern(pattern)) {
        var rule = createRule(pattern, this._ignorecase);
        var rule = createRule(pattern, this._ignoreCase);
        this._added = true;
        this._rules.push(rule);
@@ -398,7 +405,7 @@
    value: function _test(originalPath, cache, checkUnignored, slices) {
      var path = originalPath // Supports nullable path
      && checkPath.convert(originalPath);
      checkPath(path, originalPath, throwError);
      checkPath(path, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
      return this._t(path, cache, checkUnignored, slices);
    }
  }, {
@@ -461,12 +468,8 @@
  return new Ignore(options);
};
var returnFalse = function returnFalse() {
  return false;
};
var isPathValid = function isPathValid(path) {
  return checkPath(path && checkPath.convert(path), path, returnFalse);
  return checkPath(path && checkPath.convert(path), path, RETURN_FALSE);
};
factory.isPathValid = isPathValid; // Fixes typescript