@commitlint/is-ignored 19.7.1 → 19.8.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/lib/defaults.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { Matcher } from '@commitlint/types';
1
+ import { Matcher } from "@commitlint/types";
2
2
  export declare const wildcards: Matcher[];
3
3
  //# sourceMappingURL=defaults.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAe1C,eAAO,MAAM,SAAS,EAAE,OAAO,EAa9B,CAAC"}
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAe5C,eAAO,MAAM,SAAS,EAAE,OAAO,EAa9B,CAAC"}
package/lib/defaults.js CHANGED
@@ -1,10 +1,10 @@
1
- import semver from 'semver';
1
+ import semver from "semver";
2
2
  const isSemver = (c) => {
3
- const firstLine = c.split('\n').shift();
4
- if (typeof firstLine !== 'string') {
3
+ const firstLine = c.split("\n").shift();
4
+ if (typeof firstLine !== "string") {
5
5
  return false;
6
6
  }
7
- const stripped = firstLine.replace(/^chore(\([^)]+\))?:/, '').trim();
7
+ const stripped = firstLine.replace(/^chore(\([^)]+\))?:/, "").trim();
8
8
  return semver.valid(stripped) !== null;
9
9
  };
10
10
  const test = (r) => r.test.bind(r);
package/lib/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './is-ignored.js';
2
- export { default } from './is-ignored.js';
1
+ export * from "./is-ignored.js";
2
+ export { default } from "./is-ignored.js";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
package/lib/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export * from './is-ignored.js';
2
- export { default } from './is-ignored.js';
1
+ export * from "./is-ignored.js";
2
+ export { default } from "./is-ignored.js";
3
3
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,3 +1,3 @@
1
- import { IsIgnoredOptions } from '@commitlint/types';
1
+ import { IsIgnoredOptions } from "@commitlint/types";
2
2
  export default function isIgnored(commit?: string, opts?: IsIgnoredOptions): boolean;
3
3
  //# sourceMappingURL=is-ignored.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-ignored.d.ts","sourceRoot":"","sources":["../src/is-ignored.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAGnD,MAAM,CAAC,OAAO,UAAU,SAAS,CAChC,MAAM,GAAE,MAAW,EACnB,IAAI,GAAE,gBAAqB,GACzB,OAAO,CAgCT"}
1
+ {"version":3,"file":"is-ignored.d.ts","sourceRoot":"","sources":["../src/is-ignored.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,CAAC,OAAO,UAAU,SAAS,CAChC,MAAM,GAAE,MAAW,EACnB,IAAI,GAAE,gBAAqB,GACzB,OAAO,CAqBT"}
package/lib/is-ignored.js CHANGED
@@ -1,25 +1,16 @@
1
- import { wildcards } from './defaults.js';
2
- import { validateIgnoreFunction } from './validate-ignore-func.js';
3
- export default function isIgnored(commit = '', opts = {}) {
4
- const ignores = typeof opts.ignores === 'undefined' ? [] : opts.ignores;
1
+ import { wildcards } from "./defaults.js";
2
+ export default function isIgnored(commit = "", opts = {}) {
3
+ const ignores = typeof opts.ignores === "undefined" ? [] : opts.ignores;
5
4
  if (!Array.isArray(ignores)) {
6
5
  throw new Error(`ignores must be of type array, received ${ignores} of type ${typeof ignores}`);
7
6
  }
8
- // Validate ignore functions
9
- ignores.forEach(validateIgnoreFunction);
10
- const invalids = ignores.filter((c) => typeof c !== 'function');
7
+ const invalids = ignores.filter((c) => typeof c !== "function");
11
8
  if (invalids.length > 0) {
12
9
  throw new Error(`ignores must be array of type function, received items of type: ${invalids
13
10
  .map((i) => typeof i)
14
- .join(', ')}`);
11
+ .join(", ")}`);
15
12
  }
16
13
  const base = opts.defaults === false ? [] : wildcards;
17
- return [...base, ...ignores].some((w) => {
18
- const result = w(commit);
19
- if (typeof result !== 'boolean') {
20
- throw new Error(`Ignore function must return a boolean, received ${typeof result}`);
21
- }
22
- return result;
23
- });
14
+ return [...base, ...ignores].some((w) => w(commit));
24
15
  }
25
16
  //# sourceMappingURL=is-ignored.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-ignored.js","sourceRoot":"","sources":["../src/is-ignored.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAExC,OAAO,EAAC,sBAAsB,EAAC,MAAM,2BAA2B,CAAC;AAEjE,MAAM,CAAC,OAAO,UAAU,SAAS,CAChC,SAAiB,EAAE,EACnB,OAAyB,EAAE;IAE3B,MAAM,OAAO,GAAG,OAAO,IAAI,CAAC,OAAO,KAA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U,SAAS,CAChC,SAAiB,EAAE,EACnB,OAAyB,EAAE;IAE3B,MAAM,OAAO,GAAG,OAAO,IAAI,CAAC,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IAExE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CACd,2CAA2C,OAAO,YAAY,OAAO,OAAO,EAAE,CAC9E,CAAC;IACH,CAAC;IAED,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,UAAU,CAAC,CAAC;IAEhE,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACd,mEAAmE,QAAQ;aACzE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC;aACpB,IAAI,CAAC,IAAI,CAAC,EAAE,CACd,CAAC;IACH,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACtD,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AACrD,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commitlint/is-ignored",
3
3
  "type": "module",
4
- "version": "19.7.1",
4
+ "version": "19.8.1",
5
5
  "description": "Lint your commit messages",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -36,14 +36,14 @@
36
36
  },
37
37
  "license": "MIT",
38
38
  "devDependencies": {
39
- "@commitlint/parse": "^19.5.0",
40
- "@commitlint/test": "^19.5.0",
41
- "@commitlint/utils": "^19.5.0",
39
+ "@commitlint/parse": "^19.8.1",
40
+ "@commitlint/test": "^19.8.1",
41
+ "@commitlint/utils": "^19.8.1",
42
42
  "@types/semver": "^7.5.7"
43
43
  },
44
44
  "dependencies": {
45
- "@commitlint/types": "^19.5.0",
45
+ "@commitlint/types": "^19.8.1",
46
46
  "semver": "^7.6.0"
47
47
  },
48
- "gitHead": "b0e851c73ccd6c71f4f0f16af370e566c773f43c"
48
+ "gitHead": "3c302008cabeb0b08cd246b2417a51a9d745a918"
49
49
  }
@@ -1,3 +0,0 @@
1
- import { Matcher } from '@commitlint/types';
2
- export declare function validateIgnoreFunction(fn: Matcher): void;
3
- //# sourceMappingURL=validate-ignore-func.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validate-ignore-func.d.ts","sourceRoot":"","sources":["../src/validate-ignore-func.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAE1C,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,OAAO,QAajD"}
@@ -1,11 +0,0 @@
1
- export function validateIgnoreFunction(fn) {
2
- const fnString = fn.toString();
3
- // Check for dangerous patterns
4
- const dangerousPattern = /(?:process|require|import|eval|fetch|XMLHttpRequest|fs|child_process)(?:\s*\.|\s*\()|(?:exec|execFile|spawn)\s*\(/;
5
- if (dangerousPattern.test(fnString)) {
6
- // Find which pattern matched for a more specific error message
7
- const match = fnString.match(dangerousPattern);
8
- throw new Error(`Ignore function contains forbidden pattern: ${match?.[0].trim()}`);
9
- }
10
- }
11
- //# sourceMappingURL=validate-ignore-func.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validate-ignore-func.js","sourceRoot":"","sources":["../src/validate-ignore-func.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,sBAAsB,CAAC,EAAW;IACjD,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;IAE/B,+BAA+B;IAC/B,MAAM,gBAAgB,GACrB,mHAAmH,CAAC;IACrH,IAAI,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACrC,+DAA+D;QAC/D,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAC/C,MAAM,IAAI,KAAK,CACd,+CAA+C,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAClE,CAAC;IACH,CAAC;AACF,CAAC"}