This repository has been archived on 2020-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
TripSit_Suite/node_modules/pretty-quick/dist/createMatcher.js
2020-11-01 22:46:04 +00:00

26 lines
670 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _multimatch = _interopRequireDefault(require("multimatch"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const path = require('path');
var _default = pattern => {
// Match everything if no pattern was given
if (typeof pattern !== 'string' && !Array.isArray(pattern)) {
return () => true;
}
const patterns = Array.isArray(pattern) ? pattern : [pattern];
return file => (0, _multimatch.default)(path.normalize(file), patterns, {
dot: true
}).length > 0;
};
exports.default = _default;