Skip to content

Commit 3397a66

Browse files
committed
Refactor code-style
1 parent 5e813f0 commit 3397a66

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/index.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* @callback Handler
2929
* @param {Context} ctx
3030
* @param {P5Node} node
31-
* @param {Array.<Child>} [children]
31+
* @param {Array<Child>} [children]
3232
* @returns {Node}
3333
*
3434
* @typedef Options
@@ -102,7 +102,7 @@ function transform(ctx, ast) {
102102
/** @type {Handler} */
103103
// @ts-expect-error: index is fine.
104104
const fn = own.call(map, ast.nodeName) ? map[ast.nodeName] : element
105-
/** @type {Array.<Child>|undefined} */
105+
/** @type {Array<Child>|undefined} */
106106
let children
107107

108108
// Element.
@@ -134,12 +134,12 @@ function transform(ctx, ast) {
134134
* Transform children.
135135
*
136136
* @param {Context} ctx
137-
* @param {Array.<P5Node>} children
138-
* @returns {Array.<Child>}
137+
* @param {Array<P5Node>} children
138+
* @returns {Array<Child>}
139139
*/
140140
function nodes(ctx, children) {
141141
let index = -1
142-
/** @type {Array.<Child>} */
142+
/** @type {Array<Child>} */
143143
const result = []
144144

145145
while (++index < children.length) {
@@ -156,7 +156,7 @@ function nodes(ctx, children) {
156156
*
157157
* @type {Handler}
158158
* @param {P5Document} ast
159-
* @param {Array.<Child>} children
159+
* @param {Array<Child>} children
160160
* @returns {Root}
161161
*/
162162
function root(ctx, ast, children) {
@@ -217,13 +217,13 @@ function comment(_, ast) {
217217
*
218218
* @type {Handler}
219219
* @param {P5Element} ast
220-
* @param {Array.<ElementChild>} children
220+
* @param {Array<ElementChild>} children
221221
* @returns {Element}
222222
*/
223223
function element(ctx, ast, children) {
224224
const fn = ctx.schema.space === 'svg' ? s : h
225225
let index = -1
226-
/** @type {Object.<string, string>} */
226+
/** @type {Record<string, string>} */
227227
const props = {}
228228

229229
while (++index < ast.attrs.length) {
@@ -280,7 +280,7 @@ function createLocation(ctx, node, location) {
280280
}
281281

282282
if (ctx.verbose) {
283-
/** @type {Object.<string, Position|null>} */
283+
/** @type {Record<string, Position|null>} */
284284
const props = {}
285285
/** @type {string} */
286286
let key

0 commit comments

Comments
 (0)