UNPKG

851 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const defaults_1 = require("./defaults");
4function isIgnored(commit = '', opts = {}) {
5 const ignores = typeof opts.ignores === 'undefined' ? [] : opts.ignores;
6 if (!Array.isArray(ignores)) {
7 throw new Error(`ignores must be of type array, received ${ignores} of type ${typeof ignores}`);
8 }
9 const invalids = ignores.filter((c) => typeof c !== 'function');
10 if (invalids.length > 0) {
11 throw new Error(`ignores must be array of type function, received items of type: ${invalids
12 .map((i) => typeof i)
13 .join(', ')}`);
14 }
15 const base = opts.defaults === false ? [] : defaults_1.wildcards;
16 return [...base, ...ignores].some((w) => w(commit));
17}
18exports.default = isIgnored;
19//# sourceMappingURL=is-ignored.js.map
\No newline at end of file