Skip to content

Commit 901a104

Browse files
committed
Refactor
1 parent 5ff5ee4 commit 901a104

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

dev/lib/index.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @typedef {import('mdast').Text} Text
3232
* @typedef {import('mdast').ThematicBreak} ThematicBreak
3333
*
34-
* @typedef {UnistParent & {type: 'fragment', children: PhrasingContent[]}} Fragment
34+
* @typedef {UnistParent & {type: 'fragment', children: Array<PhrasingContent>}} Fragment
3535
*/
3636

3737
/**
@@ -50,14 +50,14 @@
5050
* @typedef {(this: CompileContext, token: Token) => void} Handle
5151
* @typedef {Record<string, Handle>} Handles
5252
* Token types mapping to handles
53-
* @typedef {Record<string, Record<string, unknown>|Array.<unknown>> & {canContainEols: Array.<string>, transforms: Array.<Transform>, enter: Handles, exit: Handles}} NormalizedExtension
53+
* @typedef {Record<string, Record<string, unknown>|Array<unknown>> & {canContainEols: Array<string>, transforms: Array<Transform>, enter: Handles, exit: Handles}} NormalizedExtension
5454
* @typedef {Partial<NormalizedExtension>} Extension
5555
* An mdast extension changes how markdown tokens are turned into mdast.
5656
*
5757
* @typedef CompileContext
5858
* mdast compiler context
59-
* @property {Array.<Node | Fragment>} stack
60-
* @property {Array.<Token>} tokenStack
59+
* @property {Array<Node | Fragment>} stack
60+
* @property {Array<Token>} tokenStack
6161
* @property {(key: string, value?: unknown) => void} setData
6262
* Set data into the key-value store.
6363
* @property {<K extends string>(key: K) => CompileData[K]} getData
@@ -75,7 +75,7 @@
7575
* @property {NormalizedExtension} config
7676
* Configuration.
7777
*
78-
* @typedef {{mdastExtensions?: Array.<Extension|Array.<Extension>>}} FromMarkdownOptions
78+
* @typedef {{mdastExtensions?: Array<Extension|Array<Extension>>}} FromMarkdownOptions
7979
* @typedef {ParseOptions & FromMarkdownOptions} Options
8080
*/
8181

@@ -249,7 +249,7 @@ function compiler(options = {}) {
249249
return compile
250250

251251
/**
252-
* @param {Array.<Event>} events
252+
* @param {Array<Event>} events
253253
* @returns {Root}
254254
*/
255255
function compile(events) {
@@ -259,7 +259,7 @@ function compiler(options = {}) {
259259
const stack = [tree]
260260
/** @type {CompileContext['tokenStack']} */
261261
const tokenStack = []
262-
/** @type {Array.<number>} */
262+
/** @type {Array<number>} */
263263
const listStack = []
264264
/** @type {Omit<CompileContext, 'sliceSerialize'>} */
265265
const context = {
@@ -342,7 +342,7 @@ function compiler(options = {}) {
342342
}
343343

344344
/**
345-
* @param {Array.<Event>} events
345+
* @param {Array<Event>} events
346346
* @param {number} start
347347
* @param {number} length
348348
* @returns {number}
@@ -1095,7 +1095,7 @@ function compiler(options = {}) {
10951095

10961096
/**
10971097
* @param {Extension} combined
1098-
* @param {Array.<Extension|Array.<Extension>>} extensions
1098+
* @param {Array<Extension|Array<Extension>>} extensions
10991099
* @returns {Extension}
11001100
*/
11011101
function configure(combined, extensions) {

readme.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ Value to parse (`string` or [`Buffer`][buffer]).
9797

9898
###### `options.extensions`
9999

100-
Array of syntax extensions (`Array.<MicromarkSyntaxExtension>`, default: `[]`).
100+
Array of syntax extensions (`Array<MicromarkSyntaxExtension>`, default: `[]`).
101101
Passed to [`micromark` as `extensions`][micromark-extensions].
102102

103103
###### `options.mdastExtensions`
104104

105-
Array of mdast extensions (`Array.<MdastExtension>`, default: `[]`).
105+
Array of mdast extensions (`Array<MdastExtension>`, default: `[]`).
106106

107107
##### Returns
108108

0 commit comments

Comments
 (0)