1
- # hast-util-has-property [ ![ Build ] [ build-badge ]] [ build ] [ ![ Coverage ] [ coverage-badge ]] [ coverage ] [ ![ Downloads ] [ downloads-badge ]] [ downloads ] [ ![ Chat ] [ chat-badge ]] [ chat ]
1
+ # hast-util-has-property
2
2
3
- Check whether a [ HAST node] [ hast ] is an [ element] [ ] with a [ property] [ ] .
3
+ [ ![ Build] [ build-badge ]] [ build ]
4
+ [ ![ Coverage] [ coverage-badge ]] [ coverage ]
5
+ [ ![ Downloads] [ downloads-badge ]] [ downloads ]
6
+ [ ![ Size] [ size-badge ]] [ size ]
7
+ [ ![ Sponsors] [ sponsors-badge ]] [ collective ]
8
+ [ ![ Backers] [ backers-badge ]] [ collective ]
9
+ [ ![ Chat] [ chat-badge ]] [ chat ]
4
10
5
- ## Installation
11
+ [ ** hast** ] [ hast ] utility to check if an [ * element* ] [ element ] has a
12
+ [ * property* ] [ property ] .
13
+
14
+ ## Install
6
15
7
16
[ npm] [ ] :
8
17
9
- ``` bash
18
+ ``` sh
10
19
npm install hast-util-has-property
11
20
```
12
21
13
22
## Usage
14
23
15
- ``` javascript
24
+ ``` js
16
25
var has = require (' hast-util-has-property' )
17
26
18
27
has ({type: ' text' , value: ' alpha' }, ' bravo' ) // => false
42
51
43
52
### ` hasProperty(node, name) `
44
53
45
- Check if ` node ` has a set ` name ` property.
54
+ Check if ` node ` is an [ * element* ] [ element ] that has a ` name `
55
+ [ * property name* ] [ property ] .
46
56
47
57
###### Parameters
48
58
49
- * ` node ` ([ ` Node ` ] [ node ] , optional) — Node to check.
50
- * ` name ` ([ ` string ` ] [ property ] ) - Property name to check.
59
+ * ` node ` ([ ` Node ` ] [ node ] , optional) — [ * Node* ] [ node ] to check
60
+ * ` name ` (` string ` ) - [ * Property name* ] [ property ]
51
61
52
62
###### Returns
53
63
54
- ` boolean ` — Whether ` node ` is an [ ` Element ` ] [ element ] with a property
55
- by ` name ` .
64
+ ` boolean ` — Whether ` node ` is an [ * element * ] [ element ] that has a ` name `
65
+ [ * property name* ] [ property ] .
56
66
57
67
## Contribute
58
68
59
- See [ ` contributing.md ` in ` syntax-tree/hast ` ] [ contributing ] for ways to get
69
+ See [ ` contributing.md ` in ` syntax-tree/.github ` ] [ contributing ] for ways to get
60
70
started.
71
+ See [ ` support.md ` ] [ support ] for ways to get help.
61
72
62
- This organisation has a [ Code of Conduct] [ coc ] . By interacting with this
63
- repository, organisation, or community you agree to abide by its terms.
73
+ This project has a [ Code of Conduct] [ coc ] .
74
+ By interacting with this repository, organisation, or community you agree to
75
+ abide by its terms.
64
76
65
77
## License
66
78
@@ -80,24 +92,36 @@ repository, organisation, or community you agree to abide by its terms.
80
92
81
93
[ downloads ] : https://www.npmjs.com/package/hast-util-has-property
82
94
95
+ [ size-badge ] : https://img.shields.io/bundlephobia/minzip/hast-util-has-property.svg
96
+
97
+ [ size ] : https://bundlephobia.com/result?p=hast-util-has-property
98
+
99
+ [ sponsors-badge ] : https://opencollective.com/unified/sponsors/badge.svg
100
+
101
+ [ backers-badge ] : https://opencollective.com/unified/backers/badge.svg
102
+
103
+ [ collective ] : https://opencollective.com/unified
104
+
83
105
[ chat-badge ] : https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
84
106
85
- [ chat ] : https://spectrum.chat/unified/rehype
107
+ [ chat ] : https://spectrum.chat/unified/syntax-tree
86
108
87
109
[ npm ] : https://docs.npmjs.com/cli/install
88
110
89
111
[ license ] : license
90
112
91
113
[ author ] : https://wooorm.com
92
114
115
+ [ contributing ] : https://github.com/syntax-tree/.github/blob/master/contributing.md
116
+
117
+ [ support ] : https://github.com/syntax-tree/.github/blob/master/support.md
118
+
119
+ [ coc ] : https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
120
+
93
121
[ hast ] : https://github.com/syntax-tree/hast
94
122
95
- [ node ] : https://github.com/syntax-tree/unist#node
123
+ [ node ] : https://github.com/syntax-tree/hast#nodes
96
124
97
125
[ element ] : https://github.com/syntax-tree/hast#element
98
126
99
127
[ property ] : https://github.com/syntax-tree/hast#property-names
100
-
101
- [ contributing ] : https://github.com/syntax-tree/hast/blob/master/contributing.md
102
-
103
- [ coc ] : https://github.com/syntax-tree/hast/blob/master/code-of-conduct.md
0 commit comments