Skip to content

Commit 3196283

Browse files
committed
Refactor code-style
1 parent 0deabaf commit 3196283

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
* @typedef {import('unist').Node} Node
33
* @typedef {import('unist').Parent} Parent
44
* @typedef {import('unist').Literal} Literal
5-
* @typedef {Object.<string, unknown>} Props
6-
* @typedef {Array.<Node>|string} ChildrenOrValue
5+
* @typedef {Record<string, unknown>} Props
6+
* @typedef {Array<Node>|string} ChildrenOrValue
77
*
8-
* @typedef {(<T extends string, P extends Record<string, unknown>, C extends Node[]>(type: T, props: P, children: C) => {type: T, children: C} & P)} BuildParentWithProps
8+
* @typedef {(<T extends string, P extends Record<string, unknown>, C extends Array<Node>>(type: T, props: P, children: C) => {type: T, children: C} & P)} BuildParentWithProps
99
* @typedef {(<T extends string, P extends Record<string, unknown>>(type: T, props: P, value: string) => {type: T, value: string} & P)} BuildLiteralWithProps
1010
* @typedef {(<T extends string, P extends Record<string, unknown>>(type: T, props: P) => {type: T} & P)} BuildVoidWithProps
11-
* @typedef {(<T extends string, C extends Node[]>(type: T, children: C) => {type: T, children: C})} BuildParent
11+
* @typedef {(<T extends string, C extends Array<Node>>(type: T, children: C) => {type: T, children: C})} BuildParent
1212
* @typedef {(<T extends string>(type: T, value: string) => {type: T, value: string})} BuildLiteral
1313
* @typedef {(<T extends string>(type: T) => {type: T})} BuildVoid
1414
*/

readme.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,14 @@ Creates a node from `props`, `children`, and optionally `value`.
8282

8383
###### Parameters
8484

85-
* `type` (`string`) — node [type][]
86-
* `props` (`Object`) — other values assigned to `node`
87-
* `children` ([`Array.<Node>`][node]) — children of `node`
88-
* `value` (`*`) — value of `node` (cast to string)
85+
* `type` (`string`)
86+
— node [type][]
87+
* `props` (`Record<string, unknown>`)
88+
— other values assigned to `node`
89+
* `children` ([`Array<Node>`][node])
90+
— children of `node`
91+
* `value` (`*`)
92+
— value of `node` (cast to string)
8993

9094
###### Returns
9195

0 commit comments

Comments
 (0)