UNPKG

lml-main

Version:

This is now a mono repository published into many standalone packages.

41 lines (30 loc) 1.07 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _lodash = require('lodash'); var _lodash2 = _interopRequireDefault(_lodash); var _minimatch = require('minimatch'); var _minimatch2 = _interopRequireDefault(_minimatch); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (pathName, ignoreList) { var matched = _lodash2.default.find(ignoreList, function (gb) { var glob = void 0, params = void 0; // Default minimatch params params = { matchBase: true }; if (_lodash2.default.isString(gb)) { glob = gb; } else if (_lodash2.default.isObject(gb)) { glob = gb.glob || ''; // Overwrite minimatch defaults params = _lodash2.default.assign(params, _lodash2.default.omit(gb, ['glob'])); } else { glob = ''; } return (0, _minimatch2.default)(pathName, glob, params); }); return Boolean(matched); };