Skip to content

Commit 92ef96e

Browse files
committed
Refactor code-style
1 parent 8140d6a commit 92ef96e

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

lib/index.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
* @typedef {import('vfile').VFile} VFile
2020
*
2121
* @typedef {{
22-
* parse(nodes: NlcstContent[]): NlcstRoot
22+
* parse(nodes: Array<NlcstContent>): NlcstRoot
2323
* tokenizeSource(value: string): NlcstSource
2424
* tokenizeWhiteSpace(value: string): NlcstWhiteSpace
25-
* tokenizeParagraph(nodes: NlcstSentenceContent[]): NlcstParagraph
26-
* tokenize(value: string): NlcstSentenceContent[]
25+
* tokenizeParagraph(nodes: Array<NlcstSentenceContent>): NlcstParagraph
26+
* tokenize(value: string): Array<NlcstSentenceContent>
2727
* }} ParserInstance
2828
* @typedef {new () => ParserInstance} ParserConstructor
2929
*/
@@ -104,7 +104,7 @@ export function toNlcst(tree, file, Parser) {
104104
const doc = String(file)
105105
const loc = location(doc)
106106
const parser = 'parse' in Parser ? Parser : new Parser()
107-
/** @type {NlcstContent[]} */
107+
/** @type {Array<NlcstContent>} */
108108
const results = []
109109

110110
find(tree)
@@ -136,7 +136,7 @@ export function toNlcst(tree, file, Parser) {
136136
}
137137

138138
/**
139-
* @param {HastContent[]} children
139+
* @param {Array<HastContent>} children
140140
*/
141141
function findAll(children) {
142142
let index = -1
@@ -147,11 +147,11 @@ export function toNlcst(tree, file, Parser) {
147147
}
148148

149149
/**
150-
* @param {HastElementContent[]} children
151-
* @returns {HastElementContent[]}
150+
* @param {Array<HastElementContent>} children
151+
* @returns {Array<HastElementContent>}
152152
*/
153153
function flattenAll(children) {
154-
/** @type {HastElementContent[]} */
154+
/** @type {Array<HastElementContent>} */
155155
const results = []
156156
let index = -1
157157

@@ -176,10 +176,10 @@ export function toNlcst(tree, file, Parser) {
176176
}
177177

178178
/**
179-
* @param {HastElementContent|HastElementContent[]} node
179+
* @param {HastElementContent|Array<HastElementContent>} node
180180
*/
181181
function add(node) {
182-
/** @type {NlcstSentenceContent[]|undefined} */
182+
/** @type {Array<NlcstSentenceContent>|undefined} */
183183
const result = Array.isArray(node) ? all(node) : one(node)
184184

185185
if (result && result.length > 0) {
@@ -188,7 +188,7 @@ export function toNlcst(tree, file, Parser) {
188188
}
189189

190190
/**
191-
* @param {HastElementContent[]} children
191+
* @param {Array<HastElementContent>} children
192192
*/
193193
function implicit(children) {
194194
let index = -1
@@ -225,10 +225,10 @@ export function toNlcst(tree, file, Parser) {
225225
* Convert `node` (hast) to nlcst.
226226
*
227227
* @param {HastContent} node
228-
* @returns {NlcstSentenceContent[]|undefined}
228+
* @returns {Array<NlcstSentenceContent>|undefined}
229229
*/
230230
function one(node) {
231-
/** @type {NlcstSentenceContent[]|undefined} */
231+
/** @type {Array<NlcstSentenceContent>|undefined} */
232232
let replacement
233233
/** @type {boolean|undefined} */
234234
let change
@@ -259,11 +259,11 @@ export function toNlcst(tree, file, Parser) {
259259
/**
260260
* Convert all `children` (hast) to nlcst.
261261
*
262-
* @param {HastContent[]} children
263-
* @returns {NlcstSentenceContent[]}
262+
* @param {Array<HastContent>} children
263+
* @returns {Array<NlcstSentenceContent>}
264264
*/
265265
function all(children) {
266-
/** @type {NlcstSentenceContent[]} */
266+
/** @type {Array<NlcstSentenceContent>} */
267267
const results = []
268268
let index = -1
269269

@@ -281,7 +281,7 @@ export function toNlcst(tree, file, Parser) {
281281
* Note that nlcst nodes are concrete, meaning that their starting and ending
282282
* positions can be inferred from their content.
283283
*
284-
* @template {NlcstContent[]} T
284+
* @template {Array<NlcstContent>} T
285285
* @param {T} nodes
286286
* @param {ReturnType<location>} location
287287
* @param {number} offset

0 commit comments

Comments
 (0)