2
2
* @typedef {import('hast').Element } HastElement
3
3
*
4
4
* @typedef {string|number } ConditionalPrimitive
5
- * @typedef {Object. <string, boolean> } ConditionalMap
6
- * @typedef {null|undefined|ConditionalPrimitive|ConditionalMap|Array. <ConditionalPrimitive|ConditionalMap|Array. <ConditionalPrimitive|ConditionalMap>> } Conditional
5
+ * @typedef {Record <string, boolean> } ConditionalMap
6
+ * @typedef {null|undefined|ConditionalPrimitive|ConditionalMap|Array<ConditionalPrimitive|ConditionalMap|Array<ConditionalPrimitive|ConditionalMap>> } Conditional
7
7
*
8
8
* @typedef {Record<string, boolean> } ClassMap
9
9
*/
@@ -16,13 +16,13 @@ const own = {}.hasOwnProperty
16
16
* A bit inspired by <https://github.com/JedWatson/classnames>, but for hast.
17
17
*
18
18
* @param {HastElement|Conditional } [node]
19
- * @param {Array. <Conditional> } conditionals
19
+ * @param {Array<Conditional> } conditionals
20
20
*/
21
21
export function classnames ( node , ...conditionals ) {
22
22
let index = - 1
23
23
/** @type {ClassMap } */
24
24
const map = Object . create ( null )
25
- /** @type {Array. <string> } */
25
+ /** @type {Array<string> } */
26
26
const list = [ ]
27
27
/** @type {string } */
28
28
let key
@@ -33,7 +33,7 @@ export function classnames(node, ...conditionals) {
33
33
if ( ! node . properties ) node . properties = { }
34
34
35
35
if ( node . properties . className ) {
36
- // @ts -expect-error Assume `classname` is `Array. <string>`
36
+ // @ts -expect-error Assume `classname` is `Array<string>`
37
37
add ( map , node . properties . className )
38
38
}
39
39
@@ -61,7 +61,7 @@ function add(result, conditional) {
61
61
let index = - 1
62
62
/** @type {string } */
63
63
let key
64
- /** @type {Array. <string> } */
64
+ /** @type {Array<string> } */
65
65
let list
66
66
67
67
if ( typeof conditional === 'number' ) {
0 commit comments