Skip to content

Commit deffd14

Browse files
committed
Refactor
1 parent c997820 commit deffd14

10 files changed

+23
-23
lines changed

lib/join.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import {formatCodeAsIndented} from './util/format-code-as-indented.js'
66
import {formatHeadingAsSetext} from './util/format-heading-as-setext.js'
77

8-
/** @type {Array.<Join>} */
8+
/** @type {Array<Join>} */
99
export const join = [joinDefaults]
1010

1111
/** @type {Join} */

lib/types.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525

2626
/**
2727
* @typedef Context
28-
* @property {string[]} stack
28+
* @property {Array<string>} stack
2929
* Stack of labels.
30-
* @property {number[]} indexStack
30+
* @property {Array<number>} indexStack
3131
* Positions of children in their parents.
3232
* @property {Enter} enter
3333
* @property {Options} options
34-
* @property {Array.<Unsafe>} unsafe
35-
* @property {Array.<Join>} join
34+
* @property {Array<Unsafe>} unsafe
35+
* @property {Array<Join>} join
3636
* @property {Handle} handle
3737
* @property {Handlers} handlers
3838
* @property {string|undefined} bulletCurrent
@@ -66,8 +66,8 @@
6666
/**
6767
* @typedef Unsafe
6868
* @property {string} character
69-
* @property {string|Array.<string>} [inConstruct]
70-
* @property {string|Array.<string>} [notInConstruct]
69+
* @property {string|Array<string>} [inConstruct]
70+
* @property {string|Array<string>} [notInConstruct]
7171
* @property {string} [after]
7272
* @property {string} [before]
7373
* @property {boolean} [atBreak]
@@ -95,10 +95,10 @@
9595
* @property {boolean} [setext]
9696
* @property {'_'|'*'} [strong]
9797
* @property {boolean} [tightDefinitions]
98-
* @property {Array.<Options>} [extensions]
98+
* @property {Array<Options>} [extensions]
9999
* @property {Handlers} [handlers]
100-
* @property {Array.<Join>} [join]
101-
* @property {Array.<Unsafe>} [unsafe]
100+
* @property {Array<Join>} [join]
101+
* @property {Array<Unsafe>} [unsafe]
102102
*/
103103

104104
export {}

lib/unsafe.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const fullPhrasingSpans = [
1717
'titleApostrophe'
1818
]
1919

20-
/** @type {Array.<Unsafe>} */
20+
/** @type {Array<Unsafe>} */
2121
export const unsafe = [
2222
{character: '\t', after: '[\\r\\n]', inConstruct: 'phrasing'},
2323
{character: '\t', before: '[\\r\\n]', inConstruct: 'phrasing'},

lib/util/container-flow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
export function containerFlow(parent, context) {
1414
const indexStack = context.indexStack
1515
const children = parent.children || []
16-
/** @type {Array.<string>} */
16+
/** @type {Array<string>} */
1717
const results = []
1818
let index = -1
1919

lib/util/container-phrasing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
export function containerPhrasing(parent, context, safeOptions) {
1515
const indexStack = context.indexStack
1616
const children = parent.children || []
17-
/** @type {Array.<string>} */
17+
/** @type {Array<string>} */
1818
const results = []
1919
let index = -1
2020
let before = safeOptions.before

lib/util/indent-lines.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const eol = /\r?\n|\r/g
1414
* @returns {string}
1515
*/
1616
export function indentLines(value, map) {
17-
/** @type {Array.<string>} */
17+
/** @type {Array<string>} */
1818
const result = []
1919
let start = 0
2020
let line = 0

lib/util/pattern-in-scope.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
/**
6-
* @param {Array.<string>} stack
6+
* @param {Array<string>} stack
77
* @param {Unsafe} pattern
88
* @returns {boolean}
99
*/
@@ -15,7 +15,7 @@ export function patternInScope(stack, pattern) {
1515
}
1616

1717
/**
18-
* @param {Array.<string>} stack
18+
* @param {Array<string>} stack
1919
* @param {Unsafe['inConstruct']} list
2020
* @param {boolean} none
2121
* @returns {boolean}

lib/util/safe.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import {patternInScope} from './pattern-in-scope.js'
99
/**
1010
* @param {Context} context
1111
* @param {string|null|undefined} input
12-
* @param {SafeOptions & {encode?: Array.<string>}} config
12+
* @param {SafeOptions & {encode?: Array<string>}} config
1313
* @returns {string}
1414
*/
1515
export function safe(context, input, config) {
1616
const value = (config.before || '') + (input || '') + (config.after || '')
17-
/** @type {Array.<number>} */
17+
/** @type {Array<number>} */
1818
const positions = []
19-
/** @type {Array.<string>} */
19+
/** @type {Array<string>} */
2020
const result = []
2121
/** @type {Record<number, {before: boolean, after: boolean}>} */
2222
const infos = {}
@@ -129,9 +129,9 @@ function numerical(a, b) {
129129
*/
130130
function escapeBackslashes(value, after) {
131131
const expression = /\\(?=[!-/:-@[-`{-~])/g
132-
/** @type {Array.<number>} */
132+
/** @type {Array<number>} */
133133
const positions = []
134-
/** @type {Array.<string>} */
134+
/** @type {Array<string>} */
135135
const results = []
136136
const whole = value + after
137137
let index = -1

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ Take a look at [`lib/unsafe.js`][unsafe] for examples.
246246

247247
###### `options.extensions`
248248

249-
List of extensions (`Array.<ToMarkdownExtension>`).
249+
List of extensions (`Array<ToMarkdownExtension>`).
250250
Each `ToMarkdownExtension` is an object with the same interface as `options`
251251
here.
252252

test/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2608,7 +2608,7 @@ test('listItem', (t) => {
26082608
)
26092609

26102610
/**
2611-
* @param {BlockContent|BlockContent[]} [d]
2611+
* @param {BlockContent|Array<BlockContent>} [d]
26122612
* @returns {List}
26132613
*/
26142614
function createList(d) {

0 commit comments

Comments
 (0)