Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@commitlint/ensure

Package Overview
Dependencies
Maintainers
4
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commitlint/ensure

Lint your commit messages

  • 17.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.6M
decreased by-25.74%
Maintainers
4
Weekly downloads
 
Created

What is @commitlint/ensure?

@commitlint/ensure is a utility package that provides functions to validate and ensure certain conditions on strings, such as checking if a string is a valid URL, if it matches a specific pattern, or if it adheres to a certain length. It is commonly used in conjunction with commitlint to enforce commit message conventions.

What are @commitlint/ensure's main functionalities?

isUrl

The `isUrl` function checks if a given string is a valid URL. In this example, it returns `true` for a valid URL.

const { isUrl } = require('@commitlint/ensure');

const result = isUrl('https://example.com');
console.log(result); // true

isLongerThan

The `isLongerThan` function checks if a given string is longer than a specified length. In this example, it returns `true` because 'hello' is longer than 3 characters.

const { isLongerThan } = require('@commitlint/ensure');

const result = isLongerThan('hello', 3);
console.log(result); // true

matches

The `matches` function checks if a given string matches a specified regular expression pattern. In this example, it returns `true` because 'hello' starts with 'h'.

const { matches } = require('@commitlint/ensure');

const result = matches('hello', /^h/);
console.log(result); // true

Other packages similar to @commitlint/ensure

Keywords

FAQs

Package last updated on 04 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc