@kevits/conventional-commit
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@kevits/conventional-commit

Useful functions for parsing and validating conventional commits.

Functions

Generated by tsdoc-markdown

parseFullCommit

Parse a full commit with header, body and footer and save those strings into a Commit type.

Function Type
parseFullCommit (commit: string) => Commit

Parameters:

  • commit: the whole commit

parseHeader

Parse the header of a commit.

Function Type
parseHeader (header: string) => CommitHeader

Parameters:

  • header: commit header

parseFooter

Parse the footer of a commit.

Function Type
parseFooter (footer: string) => CommitFooter[]

Parameters:

  • footer: the footer of a commit

getBodyFromCommit

Extracts the body of an full commit.

Function Type
getBodyFromCommit (fullCommit: string) => string

Parameters:

  • fullCommit: the whole commit string

parseHeaderToJson

Converts a header string to a JSON string that follow the schema of the CommitHeader type.

Function Type
parseHeaderToJson (header: string) => string

Parameters:

  • header: commit header

parseFooterToJson

Converts a footer string to a JSON string that follows the schema of the CommitFooter type.

Function Type
parseFooterToJson (footer: string) => string

Parameters:

  • footer: commit footers

validateHeader

Validates if the header follows the conventional commit specifications.

Function Type
validateHeader (headerToValidate: string) => boolean

Parameters:

  • headerToValidate: commit header

Package Sidebar

Install

npm i @kevits/conventional-commit

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

9.99 kB

Total Files

5

Last publish

Collaborators

  • kevits