Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@commitlint/parse

Package Overview
Dependencies
Maintainers
4
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commitlint/parse - npm Package Compare versions

Comparing version
20.3.1
to
20.4.0
+2
-2
lib/index.d.ts
import type { Parser } from "@commitlint/types";
import { type Commit, type Options } from "conventional-commits-parser";
export declare function parse(message: string, parser?: Parser, parserOpts?: Options): Promise<Commit>;
import { type Commit, type ParserOptions } from "conventional-commits-parser";
export declare function parse(message: string, parser?: Parser, parserOpts?: ParserOptions): Promise<Commit>;
export default parse;
//# sourceMappingURL=index.d.ts.map

@@ -1,11 +0,24 @@

import { sync } from "conventional-commits-parser";
import { CommitParser, } from "conventional-commits-parser";
// @ts-expect-error -- no typings
import defaultChangelogOpts from "conventional-changelog-angular";
export async function parse(message, parser = sync, parserOpts) {
const defaultParser = (message, options) => {
if (message === undefined || message === null) {
throw new TypeError("Expected a raw commit");
}
const parser = new CommitParser(options);
const result = parser.parse(message);
result.scope = result.scope ?? null;
result.subject = result.subject ?? null;
result.type = result.type ?? null;
return result;
};
export async function parse(message, parser = defaultParser, parserOpts) {
const preset = await defaultChangelogOpts();
const defaultOpts = preset.parserOpts;
const defaultOpts = preset.parser || preset.parserOpts;
// Support user-provided parser options passed either flat or nested under a 'parser' key
const userOpts = parserOpts?.parser || parserOpts || {};
const opts = {
...defaultOpts,
fieldPattern: null,
...(parserOpts || {}),
...userOpts,
};

@@ -12,0 +25,0 @@ const parsed = parser(message, opts);

{
"name": "@commitlint/parse",
"type": "module",
"version": "20.3.1",
"version": "20.4.0",
"description": "Lint your commit messages",

@@ -39,12 +39,11 @@ "main": "lib/index.js",

"devDependencies": {
"@commitlint/test": "^20.0.0",
"@commitlint/utils": "^20.0.0",
"@types/conventional-commits-parser": "^5.0.0"
"@commitlint/test": "^20.4.0",
"@commitlint/utils": "^20.0.0"
},
"dependencies": {
"@commitlint/types": "^20.3.1",
"conventional-changelog-angular": "^7.0.0",
"conventional-commits-parser": "^5.0.0"
"@commitlint/types": "^20.4.0",
"conventional-changelog-angular": "^8.1.0",
"conventional-commits-parser": "^6.2.1"
},
"gitHead": "be3a280aeadef5afa8ec83dbbe794ab2f72b9c3a"
"gitHead": "c68de5e24b010e38eac171f35ba18d31bb1fd3dd"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet