Socket
Socket
Sign inDemoInstall

micromark-util-classify-character

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micromark-util-classify-character

micromark utility to classify whether a character is whitespace or punctuation


Version published
Weekly downloads
6.2M
increased by6.74%
Maintainers
1
Weekly downloads
 
Created

What is micromark-util-classify-character?

The micromark-util-classify-character package is a utility for classifying characters in the context of micromark, a markdown parser. It helps in identifying character types such as whitespace, punctuation, and more, which is essential for parsing and tokenizing markdown content.

What are micromark-util-classify-character's main functionalities?

Whitespace Classification

This feature allows you to check if a character is a whitespace character. It returns true for spaces, newlines, and other whitespace characters, and false otherwise.

const { isWhitespace } = require('micromark-util-classify-character');

console.log(isWhitespace(' ')); // true
console.log(isWhitespace('\n')); // true
console.log(isWhitespace('a')); // false

Punctuation Classification

This feature allows you to check if a character is a punctuation character. It returns true for characters like periods, commas, and other punctuation marks, and false otherwise.

const { isPunctuation } = require('micromark-util-classify-character');

console.log(isPunctuation('.')); // true
console.log(isPunctuation(',')); // true
console.log(isPunctuation('a')); // false

Identifier Classification

This feature allows you to check if a character can start or continue an identifier. It returns true for valid identifier start characters (like letters and underscores) and valid identifier continuation characters (like letters, digits, and underscores).

const { isIdentifierStart, isIdentifierContinue } = require('micromark-util-classify-character');

console.log(isIdentifierStart('a')); // true
console.log(isIdentifierStart('_')); // true
console.log(isIdentifierStart('1')); // false
console.log(isIdentifierContinue('1')); // true
console.log(isIdentifierContinue('-')); // false

Other packages similar to micromark-util-classify-character

Keywords

FAQs

Package last updated on 07 Jun 2021

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