UNPKG

@the-goat/core

Version:

![npm version](https://badgen.net/npm/v/@the-goat/goat?icon=npm) ![npm downloads](https://badgen.net/npm/dt/@the-goat/goat?icon=npm) ![npm weekly downloads](https://badgen.net/npm/dw/@the-goat/goat?icon=npm) ![npm licence](https://badgen.net/npm/license/@

17 lines 637 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var minimatch_1 = __importDefault(require("minimatch")); /** * Check if given file matches one or more patterns */ function matchPattern(file, pattern) { if (!Array.isArray(pattern)) { return minimatch_1.default(file, pattern); } return pattern.filter(function (item) { return minimatch_1.default(file, item); }).length > 0; } exports.default = matchPattern; //# sourceMappingURL=matchPattern.js.map