micromark-util-character
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -55,11 +55,142 @@ /** | ||
export function markdownSpace(code: Code): boolean; | ||
export function asciiAlpha(code: Code): boolean; | ||
export function asciiAlphanumeric(code: Code): boolean; | ||
export function asciiAtext(code: Code): boolean; | ||
export function asciiDigit(code: Code): boolean; | ||
export function asciiHexDigit(code: Code): boolean; | ||
export function asciiPunctuation(code: Code): boolean; | ||
export function unicodePunctuation(code: Code): boolean; | ||
export function unicodeWhitespace(code: Code): boolean; | ||
export type Code = import('micromark-util-types').Code; | ||
/** | ||
* Check whether the character code represents an ASCII alpha (`a` through `z`, | ||
* case insensitive). | ||
* | ||
* An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha. | ||
* | ||
* An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`) | ||
* to U+005A (`Z`). | ||
* | ||
* An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`) | ||
* to U+007A (`z`). | ||
* | ||
* @param code | ||
* Code. | ||
* @returns {boolean} | ||
* Whether it matches. | ||
*/ | ||
export const asciiAlpha: (code: Code) => boolean; | ||
/** | ||
* Check whether the character code represents an ASCII alphanumeric (`a` | ||
* through `z`, case insensitive, or `0` through `9`). | ||
* | ||
* An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha | ||
* (see `asciiAlpha`). | ||
* | ||
* @param code | ||
* Code. | ||
* @returns {boolean} | ||
* Whether it matches. | ||
*/ | ||
export const asciiAlphanumeric: (code: Code) => boolean; | ||
/** | ||
* Check whether the character code represents an ASCII atext. | ||
* | ||
* atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in | ||
* the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`), | ||
* U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F | ||
* SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E | ||
* CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE | ||
* (`{`) to U+007E TILDE (`~`). | ||
* | ||
* See: | ||
* **\[RFC5322]**: | ||
* [Internet Message Format](https://tools.ietf.org/html/rfc5322). | ||
* P. Resnick. | ||
* IETF. | ||
* | ||
* @param code | ||
* Code. | ||
* @returns {boolean} | ||
* Whether it matches. | ||
*/ | ||
export const asciiAtext: (code: Code) => boolean; | ||
/** | ||
* Check whether the character code represents an ASCII digit (`0` through `9`). | ||
* | ||
* An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to | ||
* U+0039 (`9`). | ||
* | ||
* @param code | ||
* Code. | ||
* @returns {boolean} | ||
* Whether it matches. | ||
*/ | ||
export const asciiDigit: (code: Code) => boolean; | ||
/** | ||
* Check whether the character code represents an ASCII hex digit (`a` through | ||
* `f`, case insensitive, or `0` through `9`). | ||
* | ||
* An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex | ||
* digit, or an ASCII lower hex digit. | ||
* | ||
* An **ASCII upper hex digit** is a character in the inclusive range U+0041 | ||
* (`A`) to U+0046 (`F`). | ||
* | ||
* An **ASCII lower hex digit** is a character in the inclusive range U+0061 | ||
* (`a`) to U+0066 (`f`). | ||
* | ||
* @param code | ||
* Code. | ||
* @returns {boolean} | ||
* Whether it matches. | ||
*/ | ||
export const asciiHexDigit: (code: Code) => boolean; | ||
/** | ||
* Check whether the character code represents ASCII punctuation. | ||
* | ||
* An **ASCII punctuation** is a character in the inclusive ranges U+0021 | ||
* EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT | ||
* SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT | ||
* (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`). | ||
* | ||
* @param code | ||
* Code. | ||
* @returns {boolean} | ||
* Whether it matches. | ||
*/ | ||
export const asciiPunctuation: (code: Code) => boolean; | ||
/** | ||
* Check whether the character code represents Unicode punctuation. | ||
* | ||
* A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation, | ||
* Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf` | ||
* (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po` | ||
* (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII | ||
* punctuation (see `asciiPunctuation`). | ||
* | ||
* See: | ||
* **\[UNICODE]**: | ||
* [The Unicode Standard](https://www.unicode.org/versions/). | ||
* Unicode Consortium. | ||
* | ||
* @param code | ||
* Code. | ||
* @returns | ||
* Whether it matches. | ||
*/ | ||
export const unicodePunctuation: (code: Code) => boolean; | ||
/** | ||
* Check whether the character code represents Unicode whitespace. | ||
* | ||
* Note that this does handle micromark specific markdown whitespace characters. | ||
* See `markdownLineEndingOrSpace` to check that. | ||
* | ||
* A **Unicode whitespace** is a character in the Unicode `Zs` (Separator, | ||
* Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF), | ||
* U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**). | ||
* | ||
* See: | ||
* **\[UNICODE]**: | ||
* [The Unicode Standard](https://www.unicode.org/versions/). | ||
* Unicode Consortium. | ||
* | ||
* @param code | ||
* Code. | ||
* @returns | ||
* Whether it matches. | ||
*/ | ||
export const unicodeWhitespace: (code: Code) => boolean; | ||
import type { Code } from 'micromark-util-types'; | ||
//# sourceMappingURL=index.d.ts.map |
/** | ||
* @typedef {import('micromark-util-types').Code} Code | ||
* @import {Code} from 'micromark-util-types' | ||
*/ | ||
@@ -234,3 +234,5 @@ | ||
* @param {RegExp} regex | ||
* Expression. | ||
* @returns {(code: Code) => boolean} | ||
* Check. | ||
*/ | ||
@@ -237,0 +239,0 @@ function regexCheck(regex) { |
149
index.d.ts
@@ -55,11 +55,142 @@ /** | ||
export function markdownSpace(code: Code): boolean; | ||
export function asciiAlpha(code: Code): boolean; | ||
export function asciiAlphanumeric(code: Code): boolean; | ||
export function asciiAtext(code: Code): boolean; | ||
export function asciiDigit(code: Code): boolean; | ||
export function asciiHexDigit(code: Code): boolean; | ||
export function asciiPunctuation(code: Code): boolean; | ||
export function unicodePunctuation(code: Code): boolean; | ||
export function unicodeWhitespace(code: Code): boolean; | ||
export type Code = import('micromark-util-types').Code; | ||
/** | ||
* Check whether the character code represents an ASCII alpha (`a` through `z`, | ||
* case insensitive). | ||
* | ||
* An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha. | ||
* | ||
* An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`) | ||
* to U+005A (`Z`). | ||
* | ||
* An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`) | ||
* to U+007A (`z`). | ||
* | ||
* @param code | ||
* Code. | ||
* @returns {boolean} | ||
* Whether it matches. | ||
*/ | ||
export const asciiAlpha: (code: Code) => boolean; | ||
/** | ||
* Check whether the character code represents an ASCII alphanumeric (`a` | ||
* through `z`, case insensitive, or `0` through `9`). | ||
* | ||
* An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha | ||
* (see `asciiAlpha`). | ||
* | ||
* @param code | ||
* Code. | ||
* @returns {boolean} | ||
* Whether it matches. | ||
*/ | ||
export const asciiAlphanumeric: (code: Code) => boolean; | ||
/** | ||
* Check whether the character code represents an ASCII atext. | ||
* | ||
* atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in | ||
* the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`), | ||
* U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F | ||
* SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E | ||
* CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE | ||
* (`{`) to U+007E TILDE (`~`). | ||
* | ||
* See: | ||
* **\[RFC5322]**: | ||
* [Internet Message Format](https://tools.ietf.org/html/rfc5322). | ||
* P. Resnick. | ||
* IETF. | ||
* | ||
* @param code | ||
* Code. | ||
* @returns {boolean} | ||
* Whether it matches. | ||
*/ | ||
export const asciiAtext: (code: Code) => boolean; | ||
/** | ||
* Check whether the character code represents an ASCII digit (`0` through `9`). | ||
* | ||
* An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to | ||
* U+0039 (`9`). | ||
* | ||
* @param code | ||
* Code. | ||
* @returns {boolean} | ||
* Whether it matches. | ||
*/ | ||
export const asciiDigit: (code: Code) => boolean; | ||
/** | ||
* Check whether the character code represents an ASCII hex digit (`a` through | ||
* `f`, case insensitive, or `0` through `9`). | ||
* | ||
* An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex | ||
* digit, or an ASCII lower hex digit. | ||
* | ||
* An **ASCII upper hex digit** is a character in the inclusive range U+0041 | ||
* (`A`) to U+0046 (`F`). | ||
* | ||
* An **ASCII lower hex digit** is a character in the inclusive range U+0061 | ||
* (`a`) to U+0066 (`f`). | ||
* | ||
* @param code | ||
* Code. | ||
* @returns {boolean} | ||
* Whether it matches. | ||
*/ | ||
export const asciiHexDigit: (code: Code) => boolean; | ||
/** | ||
* Check whether the character code represents ASCII punctuation. | ||
* | ||
* An **ASCII punctuation** is a character in the inclusive ranges U+0021 | ||
* EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT | ||
* SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT | ||
* (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`). | ||
* | ||
* @param code | ||
* Code. | ||
* @returns {boolean} | ||
* Whether it matches. | ||
*/ | ||
export const asciiPunctuation: (code: Code) => boolean; | ||
/** | ||
* Check whether the character code represents Unicode punctuation. | ||
* | ||
* A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation, | ||
* Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf` | ||
* (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po` | ||
* (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII | ||
* punctuation (see `asciiPunctuation`). | ||
* | ||
* See: | ||
* **\[UNICODE]**: | ||
* [The Unicode Standard](https://www.unicode.org/versions/). | ||
* Unicode Consortium. | ||
* | ||
* @param code | ||
* Code. | ||
* @returns | ||
* Whether it matches. | ||
*/ | ||
export const unicodePunctuation: (code: Code) => boolean; | ||
/** | ||
* Check whether the character code represents Unicode whitespace. | ||
* | ||
* Note that this does handle micromark specific markdown whitespace characters. | ||
* See `markdownLineEndingOrSpace` to check that. | ||
* | ||
* A **Unicode whitespace** is a character in the Unicode `Zs` (Separator, | ||
* Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF), | ||
* U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**). | ||
* | ||
* See: | ||
* **\[UNICODE]**: | ||
* [The Unicode Standard](https://www.unicode.org/versions/). | ||
* Unicode Consortium. | ||
* | ||
* @param code | ||
* Code. | ||
* @returns | ||
* Whether it matches. | ||
*/ | ||
export const unicodeWhitespace: (code: Code) => boolean; | ||
import type { Code } from 'micromark-util-types'; | ||
//# sourceMappingURL=index.d.ts.map |
/** | ||
* @typedef {import('micromark-util-types').Code} Code | ||
* @import {Code} from 'micromark-util-types' | ||
*/ | ||
@@ -228,3 +228,5 @@ | ||
* @param {RegExp} regex | ||
* Expression. | ||
* @returns {(code: Code) => boolean} | ||
* Check. | ||
*/ | ||
@@ -231,0 +233,0 @@ function regexCheck(regex) { |
{ | ||
"name": "micromark-util-character", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "micromark utility to handle character codes", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -15,24 +15,24 @@ # micromark-util-character | ||
* [What is this?](#what-is-this) | ||
* [When should I use this?](#when-should-i-use-this) | ||
* [Install](#install) | ||
* [Use](#use) | ||
* [API](#api) | ||
* [`asciiAlpha(code)`](#asciialphacode) | ||
* [`asciiAlphanumeric(code)`](#asciialphanumericcode) | ||
* [`asciiAtext(code)`](#asciiatextcode) | ||
* [`asciiControl(code)`](#asciicontrolcode) | ||
* [`asciiDigit(code)`](#asciidigitcode) | ||
* [`asciiHexDigit(code)`](#asciihexdigitcode) | ||
* [`asciiPunctuation(code)`](#asciipunctuationcode) | ||
* [`markdownLineEnding(code)`](#markdownlineendingcode) | ||
* [`markdownLineEndingOrSpace(code)`](#markdownlineendingorspacecode) | ||
* [`markdownSpace(code)`](#markdownspacecode) | ||
* [`unicodePunctuation(code)`](#unicodepunctuationcode) | ||
* [`unicodeWhitespace(code)`](#unicodewhitespacecode) | ||
* [Types](#types) | ||
* [Compatibility](#compatibility) | ||
* [Security](#security) | ||
* [Contribute](#contribute) | ||
* [License](#license) | ||
* [What is this?](#what-is-this) | ||
* [When should I use this?](#when-should-i-use-this) | ||
* [Install](#install) | ||
* [Use](#use) | ||
* [API](#api) | ||
* [`asciiAlpha(code)`](#asciialphacode) | ||
* [`asciiAlphanumeric(code)`](#asciialphanumericcode) | ||
* [`asciiAtext(code)`](#asciiatextcode) | ||
* [`asciiControl(code)`](#asciicontrolcode) | ||
* [`asciiDigit(code)`](#asciidigitcode) | ||
* [`asciiHexDigit(code)`](#asciihexdigitcode) | ||
* [`asciiPunctuation(code)`](#asciipunctuationcode) | ||
* [`markdownLineEnding(code)`](#markdownlineendingcode) | ||
* [`markdownLineEndingOrSpace(code)`](#markdownlineendingorspacecode) | ||
* [`markdownSpace(code)`](#markdownspacecode) | ||
* [`unicodePunctuation(code)`](#unicodepunctuationcode) | ||
* [`unicodeWhitespace(code)`](#unicodewhitespacecode) | ||
* [Types](#types) | ||
* [Compatibility](#compatibility) | ||
* [Security](#security) | ||
* [Contribute](#contribute) | ||
* [License](#license) | ||
@@ -111,4 +111,4 @@ ## What is this? | ||
* `code` (`Code`) | ||
— code | ||
* `code` (`Code`) | ||
— code | ||
@@ -129,4 +129,4 @@ ###### Returns | ||
* `code` (`Code`) | ||
— code | ||
* `code` (`Code`) | ||
— code | ||
@@ -155,4 +155,4 @@ ###### Returns | ||
* `code` (`Code`) | ||
— code | ||
* `code` (`Code`) | ||
— code | ||
@@ -172,4 +172,4 @@ ###### Returns | ||
* `code` (`Code`) | ||
— code | ||
* `code` (`Code`) | ||
— code | ||
@@ -190,4 +190,4 @@ ###### Returns | ||
* `code` (`Code`) | ||
— code | ||
* `code` (`Code`) | ||
— code | ||
@@ -214,4 +214,4 @@ ###### Returns | ||
* `code` (`Code`) | ||
— code | ||
* `code` (`Code`) | ||
— code | ||
@@ -233,4 +233,4 @@ ###### Returns | ||
* `code` (`Code`) | ||
— code | ||
* `code` (`Code`) | ||
— code | ||
@@ -254,4 +254,4 @@ ###### Returns | ||
* `code` (`Code`) | ||
— code | ||
* `code` (`Code`) | ||
— code | ||
@@ -269,4 +269,4 @@ ###### Returns | ||
* `code` (`Code`) | ||
— code | ||
* `code` (`Code`) | ||
— code | ||
@@ -290,4 +290,4 @@ ###### Returns | ||
* `code` (`Code`) | ||
— code | ||
* `code` (`Code`) | ||
— code | ||
@@ -314,4 +314,4 @@ ###### Returns | ||
* `code` (`Code`) | ||
— code | ||
* `code` (`Code`) | ||
— code | ||
@@ -339,4 +339,4 @@ ###### Returns | ||
* `code` (`Code`) | ||
— code | ||
* `code` (`Code`) | ||
— code | ||
@@ -360,4 +360,4 @@ ###### Returns | ||
This means we try to keep the current release line, | ||
`micromark-util-character@^2`, compatible with Node.js 16. | ||
This package works with `micromark@^3`. | ||
`micromark-util-character@2`, compatible with Node.js 16. | ||
This package works with `micromark@3`. | ||
@@ -364,0 +364,0 @@ ## Security |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42421
9
856