Skip to content

Commit cb909b6

Browse files
committed
Refactor code-style
1 parent d79beff commit cb909b6

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

lib/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @typedef {{[attribute: string]: XValue}} XAttributes Attributes to support JS primitive types
99
*
1010
* @typedef {string|number|null|undefined} XPrimitiveChild
11-
* @typedef {Array.<Node|XPrimitiveChild>} XArrayChild
11+
* @typedef {Array<Node|XPrimitiveChild>} XArrayChild
1212
* @typedef {Node|XPrimitiveChild|XArrayChild} XChild
1313
* @typedef {import('./jsx-classic').Element} x.JSX.Element
1414
* @typedef {import('./jsx-classic').IntrinsicAttributes} x.JSX.IntrinsicAttributes
@@ -27,9 +27,9 @@ export const x =
2727
/**
2828
* @type {{
2929
* (): Root
30-
* (name: null|undefined, ...children: XChild[]): Root
31-
* (name: string, attributes: XAttributes, ...children: XChild[]): Element
32-
* (name: string, ...children: XChild[]): Element
30+
* (name: null|undefined, ...children: Array<XChild>): Root
31+
* (name: string, attributes: XAttributes, ...children: Array<XChild>): Element
32+
* (name: string, ...children: Array<XChild>): Element
3333
* }}
3434
*/
3535
(
@@ -38,7 +38,7 @@ export const x =
3838
*
3939
* @param {string|null} [name]
4040
* @param {XAttributes|XChild} [attributes]
41-
* @param {XChild[]} children
41+
* @param {Array<XChild>} children
4242
* @returns {XResult}
4343
*/
4444
function (name, attributes, ...children) {
@@ -86,7 +86,7 @@ export const x =
8686
)
8787

8888
/**
89-
* @param {Array.<Child>} nodes
89+
* @param {Array<Child>} nodes
9090
* @param {XChild} value
9191
*/
9292
function addChild(nodes, value) {

readme.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ When nullish, a [`Root`][root] is built instead.
166166

167167
###### `attributes`
168168

169-
Map of attributes (`Object.<*>`, optional).
169+
Map of attributes (`Record<string, string|number|boolean|null|undefined>`,
170+
optional).
170171
Nullish (`null` or `undefined`) or `NaN` values are ignored, other values are
171172
turned to strings.
172173

@@ -176,7 +177,7 @@ Cannot be omitted when building an [`Element`][element] if the first child is a
176177

177178
###### `children`
178179

179-
(Lists of) children (`string`, `number`, `Node`, `Array.<children>`, optional).
180+
(Lists of) children (`string`, `number`, `Node`, `Array<children>`, optional).
180181
When strings or numbers are encountered, they are mapped to [`Text`][text]
181182
nodes.
182183
If a [`Root`][root] node is given, its children are used instead.

0 commit comments

Comments
 (0)