8
8
[ ![ Backers] [ backers-badge ]] [ collective ]
9
9
[ ![ Chat] [ chat-badge ]] [ chat ]
10
10
11
- Assert [ mdast] [ ] nodes .
11
+ [ ** mdast** ] [ mdast ] utility to assert trees .
12
12
13
- ## Installation
13
+ ## Install
14
14
15
15
[ npm] [ ] :
16
16
17
- ``` bash
17
+ ``` sh
18
18
npm install mdast-util-assert
19
19
```
20
20
21
21
## Usage
22
22
23
- ``` javascript
23
+ ``` js
24
24
var assert = require (' mdast-util-assert' )
25
25
26
26
assert ({type: ' root' , children: []})
@@ -39,19 +39,21 @@ assert({type: 'paragraph', value: 'foo'})
39
39
40
40
### ` assert(node) `
41
41
42
- Assert that ` node ` is a valid [ mdast] [ ] node. If ` node ` has ` children ` ,
43
- all children will be asserted as well.
42
+ Assert that [ ` tree ` ] [ tree ] is a valid [ mdast] [ ] [ node] [ ] .
43
+ If ` tree ` is a [ parent ] [ ] , all [ child ] [ ] ren will be asserted as well.
44
44
45
45
The ` assert.parent ` , ` assert.text ` , ` assert.void ` , and ` assert.wrap `
46
46
methods from [ ` unist-util-assert ` ] [ unist-util-assert ] are also included.
47
47
48
48
## Contribute
49
49
50
- See [ ` contributing.md ` in ` syntax-tree/mdast ` ] [ contributing ] for ways to get
50
+ See [ ` contributing.md ` in ` syntax-tree/.github ` ] [ contributing ] for ways to get
51
51
started.
52
+ See [ ` support.md ` ] [ support ] for ways to get help.
52
53
53
- This organisation has a [ Code of Conduct] [ coc ] . By interacting with this
54
- repository, organisation, or community you agree to abide by its terms.
54
+ This project has a [ Code of Conduct] [ coc ] .
55
+ By interacting with this repository, organisation, or community you agree to
56
+ abide by its terms.
55
57
56
58
## License
57
59
@@ -91,10 +93,20 @@ repository, organisation, or community you agree to abide by its terms.
91
93
92
94
[ author ] : https://wooorm.com
93
95
96
+ [ contributing ] : https://github.com/syntax-tree/.github/blob/master/contributing.md
97
+
98
+ [ support ] : https://github.com/syntax-tree/.github/blob/master/support.md
99
+
100
+ [ coc ] : https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
101
+
94
102
[ mdast ] : https://github.com/syntax-tree/mdast
95
103
96
104
[ unist-util-assert ] : https://github.com/syntax-tree/unist-util-assert
97
105
98
- [ contributing ] : https://github.com/syntax-tree/mdast/blob/master/contributing.md
106
+ [ tree ] : https://github.com/syntax-tree/unist#tree
107
+
108
+ [ child ] : https://github.com/syntax-tree/unist#child
109
+
110
+ [ node ] : https://github.com/syntax-tree/mdast#nodes
99
111
100
- [ coc ] : https://github.com/syntax-tree/mdast/blob/master/code-of-conduct.md
112
+ [ parent ] : https://github.com/syntax-tree/mdast#parent
0 commit comments