@forsakringskassan/commitlint-config 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commitlint.js +18 -1
- package/package.json +1 -1
package/dist/commitlint.js
CHANGED
|
@@ -256387,18 +256387,35 @@ var wildcards = [
|
|
|
256387
256387
|
test(/^Auto-merged (.*?) into (.*)/)
|
|
256388
256388
|
];
|
|
256389
256389
|
|
|
256390
|
+
// node_modules/@commitlint/is-ignored/lib/validate-ignore-func.js
|
|
256391
|
+
function validateIgnoreFunction(fn) {
|
|
256392
|
+
const fnString = fn.toString();
|
|
256393
|
+
const dangerousPattern = /(?:process|require|import|eval|fetch|XMLHttpRequest|fs|child_process)(?:\s*\.|\s*\()|(?:exec|execFile|spawn)\s*\(/;
|
|
256394
|
+
if (dangerousPattern.test(fnString)) {
|
|
256395
|
+
const match2 = fnString.match(dangerousPattern);
|
|
256396
|
+
throw new Error(`Ignore function contains forbidden pattern: ${match2?.[0].trim()}`);
|
|
256397
|
+
}
|
|
256398
|
+
}
|
|
256399
|
+
|
|
256390
256400
|
// node_modules/@commitlint/is-ignored/lib/is-ignored.js
|
|
256391
256401
|
function isIgnored(commit = "", opts = {}) {
|
|
256392
256402
|
const ignores = typeof opts.ignores === "undefined" ? [] : opts.ignores;
|
|
256393
256403
|
if (!Array.isArray(ignores)) {
|
|
256394
256404
|
throw new Error(`ignores must be of type array, received ${ignores} of type ${typeof ignores}`);
|
|
256395
256405
|
}
|
|
256406
|
+
ignores.forEach(validateIgnoreFunction);
|
|
256396
256407
|
const invalids = ignores.filter((c) => typeof c !== "function");
|
|
256397
256408
|
if (invalids.length > 0) {
|
|
256398
256409
|
throw new Error(`ignores must be array of type function, received items of type: ${invalids.map((i) => typeof i).join(", ")}`);
|
|
256399
256410
|
}
|
|
256400
256411
|
const base = opts.defaults === false ? [] : wildcards;
|
|
256401
|
-
return [...base, ...ignores].some((w) =>
|
|
256412
|
+
return [...base, ...ignores].some((w) => {
|
|
256413
|
+
const result = w(commit);
|
|
256414
|
+
if (typeof result !== "boolean") {
|
|
256415
|
+
throw new Error(`Ignore function must return a boolean, received ${typeof result}`);
|
|
256416
|
+
}
|
|
256417
|
+
return result;
|
|
256418
|
+
});
|
|
256402
256419
|
}
|
|
256403
256420
|
|
|
256404
256421
|
// node_modules/@commitlint/parse/lib/index.js
|