Skip to content

Commit 49692d6

Browse files
committed
Update @types/hast
1 parent 8f8487f commit 49692d6

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @typedef {Exclude<P5Node, P5Document | P5Fragment>} P5Child
1313
* @typedef {import('property-information').Schema} Schema
1414
* @typedef {import('hast').Root} Root
15-
* @typedef {import('hast').DocType} Doctype
15+
* @typedef {import('hast').Doctype} Doctype
1616
* @typedef {import('hast').Element} Element
1717
* @typedef {import('hast').Text} Text
1818
* @typedef {import('hast').Comment} Comment

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"index.js"
3535
],
3636
"dependencies": {
37-
"@types/hast": "^2.0.0",
37+
"@types/hast": "^3.0.0",
3838
"comma-separated-tokens": "^2.0.0",
3939
"property-information": "^6.0.0",
4040
"space-separated-tokens": "^2.0.0",

test.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ test('toParse5', () => {
1717
toParse5({
1818
type: 'root',
1919
children: [
20-
{type: 'doctype', name: 'html'},
20+
{type: 'doctype'},
2121
{
2222
type: 'element',
2323
tagName: 'html',
24+
properties: {},
2425
children: [
25-
{type: 'element', tagName: 'head', children: []},
26-
{type: 'element', tagName: 'body', children: []}
26+
{type: 'element', tagName: 'head', properties: {}, children: []},
27+
{type: 'element', tagName: 'body', properties: {}, children: []}
2728
]
2829
}
2930
]
@@ -44,9 +45,10 @@ test('root', () => {
4445
{
4546
type: 'element',
4647
tagName: 'html',
48+
properties: {},
4749
children: [
48-
{type: 'element', tagName: 'head', children: []},
49-
{type: 'element', tagName: 'body', children: []}
50+
{type: 'element', tagName: 'head', properties: {}, children: []},
51+
{type: 'element', tagName: 'body', properties: {}, children: []}
5052
]
5153
}
5254
]
@@ -61,13 +63,14 @@ test('root', () => {
6163
toParse5({
6264
type: 'root',
6365
children: [
64-
{type: 'doctype', name: 'html'},
66+
{type: 'doctype'},
6567
{
6668
type: 'element',
6769
tagName: 'html',
70+
properties: {},
6871
children: [
69-
{type: 'element', tagName: 'head', children: []},
70-
{type: 'element', tagName: 'body', children: []}
72+
{type: 'element', tagName: 'head', properties: {}, children: []},
73+
{type: 'element', tagName: 'body', properties: {}, children: []}
7174
]
7275
}
7376
]
@@ -84,7 +87,7 @@ test('doctype', () => {
8487
expected.parentNode = undefined
8588

8689
assert.deepEqual(
87-
toParse5({type: 'doctype', name: 'html'}),
90+
toParse5({type: 'doctype'}),
8891
expected,
8992
'should transform a doctype (modern)'
9093
)
@@ -124,6 +127,7 @@ test('element', () => {
124127
toParse5({
125128
type: 'element',
126129
tagName: 'h1',
130+
properties: {},
127131
children: [{type: 'text', value: 'Alpha'}]
128132
})
129133
),
@@ -267,12 +271,14 @@ test('element', () => {
267271
{
268272
type: 'element',
269273
tagName: 'b',
274+
properties: {},
270275
children: [{type: 'text', value: 'bold'}]
271276
},
272277
{type: 'text', value: ' and '},
273278
{
274279
type: 'element',
275280
tagName: 'i',
281+
properties: {},
276282
children: [{type: 'text', value: 'italic'}]
277283
}
278284
]
@@ -301,6 +307,7 @@ test('position', () => {
301307
toParse5({
302308
type: 'element',
303309
tagName: 'h1',
310+
properties: {},
304311
children: [
305312
{
306313
type: 'text',

0 commit comments

Comments
 (0)