Skip to content

Commit d27d04d

Browse files
committed
Update @types/mdast and friends
1 parent b35f9c7 commit d27d04d

File tree

2 files changed

+54
-40
lines changed

2 files changed

+54
-40
lines changed

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,25 @@
3838
"index.js"
3939
],
4040
"dependencies": {
41-
"@types/mdast": "^3.0.0",
42-
"@types/unist": "^2.0.0",
41+
"@types/mdast": "^4.0.0",
42+
"@types/unist": "^3.0.0",
4343
"longest-streak": "^3.0.0",
44-
"mdast-util-phrasing": "^3.0.0",
45-
"mdast-util-to-string": "^3.0.0",
46-
"micromark-util-decode-string": "^1.0.0",
47-
"unist-util-visit": "^4.0.0",
44+
"mdast-util-phrasing": "^4.0.0",
45+
"mdast-util-to-string": "^4.0.0",
46+
"micromark-util-decode-string": "^2.0.0",
47+
"unist-util-visit": "^5.0.0",
4848
"zwitch": "^2.0.0"
4949
},
5050
"devDependencies": {
5151
"@types/node": "^20.0.0",
5252
"c8": "^8.0.0",
53-
"mdast-util-from-markdown": "^1.0.0",
53+
"mdast-util-from-markdown": "^2.0.0",
5454
"prettier": "^2.0.0",
5555
"remark-cli": "^11.0.0",
5656
"remark-preset-wooorm": "^9.0.0",
5757
"type-coverage": "^2.0.0",
5858
"typescript": "^5.0.0",
59-
"unist-util-remove-position": "^4.0.0",
59+
"unist-util-remove-position": "^5.0.0",
6060
"xo": "^0.54.0"
6161
},
6262
"scripts": {

test/index.js

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3579,132 +3579,146 @@ test('roundtrip', () => {
35793579
let tree = from('* a\n- b')
35803580

35813581
assert.deepEqual(
3582-
removePosition(tree, true),
3583-
removePosition(from(to(tree, {bullet: '*', bulletOther: '-'})), true),
3582+
removePosition(tree, {force: true}),
3583+
removePosition(from(to(tree, {bullet: '*', bulletOther: '-'})), {
3584+
force: true
3585+
}),
35843586
'should roundtrip different lists w/ `bulletOther`'
35853587
)
35863588

35873589
tree = from('* ---\n- - +\n+ b')
35883590

35893591
assert.deepEqual(
3590-
removePosition(tree, true),
3591-
removePosition(from(to(tree, {bullet: '*', bulletOther: '-'})), true),
3592+
removePosition(tree, {force: true}),
3593+
removePosition(from(to(tree, {bullet: '*', bulletOther: '-'})), {
3594+
force: true
3595+
}),
35923596
'should roundtrip different lists w/ `bulletOther` and lists that could turn into thematic breaks (1)'
35933597
)
35943598

35953599
tree = from('- - +\n* ---\n+ b')
35963600

35973601
assert.deepEqual(
3598-
removePosition(tree, true),
3599-
removePosition(from(to(tree, {bullet: '*', bulletOther: '-'})), true),
3602+
removePosition(tree, {force: true}),
3603+
removePosition(from(to(tree, {bullet: '*', bulletOther: '-'})), {
3604+
force: true
3605+
}),
36003606
'should roundtrip different lists w/ `bulletOther` and lists that could turn into thematic breaks (2)'
36013607
)
36023608

36033609
tree = from('- - +\n- -')
36043610

36053611
assert.deepEqual(
3606-
removePosition(tree, true),
3607-
removePosition(from(to(tree, {bullet: '*', bulletOther: '-'})), true),
3612+
removePosition(tree, {force: true}),
3613+
removePosition(from(to(tree, {bullet: '*', bulletOther: '-'})), {
3614+
force: true
3615+
}),
36083616
'should roundtrip different lists w/ `bulletOther` and lists that could turn into thematic breaks (3)'
36093617
)
36103618

36113619
tree = from('* - +\n *\n -\n +')
36123620

36133621
assert.deepEqual(
3614-
removePosition(tree, true),
3615-
removePosition(from(to(tree, {bullet: '*', bulletOther: '-'})), true),
3622+
removePosition(tree, {force: true}),
3623+
removePosition(from(to(tree, {bullet: '*', bulletOther: '-'})), {
3624+
force: true
3625+
}),
36163626
'should roundtrip different lists w/ `bulletOther` and lists that could turn into thematic breaks (4)'
36173627
)
36183628

36193629
tree = from('* - +\n - *\n -\n +')
36203630

36213631
assert.deepEqual(
3622-
removePosition(tree, true),
3623-
removePosition(from(to(tree, {bullet: '*', bulletOther: '-'})), true),
3632+
removePosition(tree, {force: true}),
3633+
removePosition(from(to(tree, {bullet: '*', bulletOther: '-'})), {
3634+
force: true
3635+
}),
36243636
'should roundtrip different lists w/ `bulletOther` and lists that could turn into thematic breaks (5)'
36253637
)
36263638

36273639
tree = from('- +\n- *\n -\n +')
36283640

36293641
assert.deepEqual(
3630-
removePosition(tree, true),
3631-
removePosition(from(to(tree, {bullet: '*', bulletOther: '-'})), true),
3642+
removePosition(tree, {force: true}),
3643+
removePosition(from(to(tree, {bullet: '*', bulletOther: '-'})), {
3644+
force: true
3645+
}),
36323646
'should roundtrip different lists w/ `bulletOther` and lists that could turn into thematic breaks (6)'
36333647
)
36343648

36353649
tree = from('1. a\n1) b')
36363650

36373651
assert.deepEqual(
3638-
removePosition(tree, true),
3652+
removePosition(tree, {force: true}),
36393653
removePosition(
36403654
from(to(tree, {bulletOrdered: '.', bulletOrderedOther: ')'})),
3641-
true
3655+
{force: true}
36423656
),
36433657
'should roundtrip different lists w/ `bulletOrderedOther`'
36443658
)
36453659

36463660
tree = from('1. ---\n1) 1. 1)\n1. b')
36473661

36483662
assert.deepEqual(
3649-
removePosition(tree, true),
3663+
removePosition(tree, {force: true}),
36503664
removePosition(
36513665
from(to(tree, {bulletOrdered: '.', bulletOrderedOther: ')'})),
3652-
true
3666+
{force: true}
36533667
),
36543668
'should roundtrip different lists w/ `bulletOrderedOther` and lists that could turn into thematic breaks (1)'
36553669
)
36563670

36573671
tree = from('1. 1. 1)\n1) ---\n1. b')
36583672

36593673
assert.deepEqual(
3660-
removePosition(tree, true),
3674+
removePosition(tree, {force: true}),
36613675
removePosition(
36623676
from(to(tree, {bulletOrdered: '.', bulletOrderedOther: ')'})),
3663-
true
3677+
{force: true}
36643678
),
36653679
'should roundtrip different lists w/ `bulletOrderedOther` and lists that could turn into thematic breaks (2)'
36663680
)
36673681

36683682
tree = from('1. 1. 1)\n1. 1.')
36693683

36703684
assert.deepEqual(
3671-
removePosition(tree, true),
3685+
removePosition(tree, {force: true}),
36723686
removePosition(
36733687
from(to(tree, {bulletOrdered: '.', bulletOrderedOther: ')'})),
3674-
true
3688+
{force: true}
36753689
),
36763690
'should roundtrip different lists w/ `bulletOrderedOther` and lists that could turn into thematic breaks (3)'
36773691
)
36783692

36793693
tree = from('1. 1) 1.\n 1.\n 1)\n 1.')
36803694

36813695
assert.deepEqual(
3682-
removePosition(tree, true),
3696+
removePosition(tree, {force: true}),
36833697
removePosition(
36843698
from(to(tree, {bulletOrdered: '.', bulletOrderedOther: ')'})),
3685-
true
3699+
{force: true}
36863700
),
36873701
'should roundtrip different lists w/ `bulletOrderedOther` and lists that could turn into thematic breaks (4)'
36883702
)
36893703

36903704
tree = from('1. 1) 1.\n 1) 1.\n 1)\n 1.')
36913705

36923706
assert.deepEqual(
3693-
removePosition(tree, true),
3707+
removePosition(tree, {force: true}),
36943708
removePosition(
36953709
from(to(tree, {bulletOrdered: '.', bulletOrderedOther: ')'})),
3696-
true
3710+
{force: true}
36973711
),
36983712
'should roundtrip different lists w/ `bulletOrderedOther` and lists that could turn into thematic breaks (5)'
36993713
)
37003714

37013715
tree = from('1. 1)\n1. 1.\n 1)\n 1.')
37023716

37033717
assert.deepEqual(
3704-
removePosition(tree, true),
3718+
removePosition(tree, {force: true}),
37053719
removePosition(
37063720
from(to(tree, {bulletOrdered: '.', bulletOrderedOther: ')'})),
3707-
true
3721+
{force: true}
37083722
),
37093723
'should roundtrip different lists w/ `bulletOrderedOther` and lists that could turn into thematic breaks (6)'
37103724
)
@@ -3753,8 +3767,8 @@ a *\\** is this emphasis? *\\**`
37533767
tree = from(doc)
37543768

37553769
assert.deepEqual(
3756-
removePosition(from(to(tree)), true),
3757-
removePosition(tree, true),
3770+
removePosition(from(to(tree)), {force: true}),
3771+
removePosition(tree, {force: true}),
37583772
'should roundtrip asterisks (tree)'
37593773
)
37603774

@@ -3786,8 +3800,8 @@ a _\\__ is this emphasis? _\\__`
37863800
tree = from(doc)
37873801

37883802
assert.deepEqual(
3789-
removePosition(from(to(tree)), true),
3790-
removePosition(tree, true),
3803+
removePosition(from(to(tree)), {force: true}),
3804+
removePosition(tree, {force: true}),
37913805
'should roundtrip underscores (tree)'
37923806
)
37933807

0 commit comments

Comments
 (0)