|
1 | 1 | /**
|
2 |
| - * @typedef Options Configuration. |
3 |
| - * @property {Test} [ignore] `unist-util-is` test used to assert parents |
| 2 | + * @typedef Options |
| 3 | + * Configuration (optional). |
| 4 | + * @property {Test} [ignore] |
| 5 | + * `unist-util-is` test used to assert parents |
4 | 6 | *
|
5 | 7 | * @typedef {import('mdast').Root} Root
|
6 | 8 | * @typedef {import('mdast').Content} Content
|
|
20 | 22 | * @typedef {string|ReplaceFunction} Replace
|
21 | 23 | *
|
22 | 24 | * @typedef {[Find, Replace]} FindAndReplaceTuple
|
23 |
| - * @typedef {Object.<string, Replace>} FindAndReplaceSchema |
24 |
| - * @typedef {Array.<FindAndReplaceTuple>} FindAndReplaceList |
| 25 | + * @typedef {Record<string, Replace>} FindAndReplaceSchema |
| 26 | + * @typedef {Array<FindAndReplaceTuple>} FindAndReplaceList |
25 | 27 | *
|
26 | 28 | * @typedef {[RegExp, ReplaceFunction]} Pair
|
27 |
| - * @typedef {Array.<Pair>} Pairs |
| 29 | + * @typedef {Array<Pair>} Pairs |
28 | 30 | */
|
29 | 31 |
|
30 | 32 | /**
|
31 | 33 | * @callback ReplaceFunction
|
32 | 34 | * @param {...any} parameters
|
33 |
| - * @returns {Array.<PhrasingContent>|PhrasingContent|string|false|undefined|null} |
| 35 | + * @returns {Array<PhrasingContent>|PhrasingContent|string|false|undefined|null} |
34 | 36 | */
|
35 | 37 |
|
36 | 38 | import escape from 'escape-string-regexp'
|
@@ -132,7 +134,7 @@ export const findAndReplace =
|
132 | 134 | let start = 0
|
133 | 135 | // @ts-expect-error: TS is wrong, some of these children can be text.
|
134 | 136 | let index = parent.children.indexOf(node)
|
135 |
| - /** @type {Array.<PhrasingContent>} */ |
| 137 | + /** @type {Array<PhrasingContent>} */ |
136 | 138 | let nodes = []
|
137 | 139 | /** @type {number|undefined} */
|
138 | 140 | let position
|
|
0 commit comments