17
17
* [ Install] ( #install )
18
18
* [ Use] ( #use )
19
19
* [ API] ( #api )
20
- * [ ` hasProperty(node, name ) ` ] ( #haspropertynode-name )
20
+ * [ ` hasProperty(node, field ) ` ] ( #haspropertynode-field )
21
21
* [ Types] ( #types )
22
22
* [ Compatibility] ( #compatibility )
23
23
* [ Security] ( #security )
@@ -38,7 +38,7 @@ looking for!
38
38
## Install
39
39
40
40
This package is [ ESM only] [ esm ] .
41
- In Node.js (version 12.20+, 14.14+, 16.0+, or 18 .0+), install with [ npm] [ ] :
41
+ In Node.js (version 14.14+ and 16 .0+), install with [ npm] [ ] :
42
42
43
43
``` sh
44
44
npm install hast-util-has-property
@@ -88,22 +88,21 @@ hasProperty(
88
88
89
89
## API
90
90
91
- This package exports the identifier ` hasProperty ` .
91
+ This package exports the identifier [ ` hasProperty ` ] [ hasproperty ] .
92
92
There is no default export.
93
93
94
- ### ` hasProperty(node, name ) `
94
+ ### ` hasProperty(node, field ) `
95
95
96
- Check if ` node ` is an [ * element* ] [ element ] that has a ` name `
97
- [ * property name* ] [ property ] .
96
+ Check if ` node ` is an element and has a ` field ` property.
98
97
99
98
###### Parameters
100
99
101
- * ` node ` ([ ` Node ` ] [ node ] , optional ) — [ * Node * ] [ node ] to check, likely element
102
- * ` name ` (` string ` ) - [ * Property name* ] [ property ]
100
+ * ` node ` (` unknown ` ) — thing to check (typically [ ` Element ` ] [ element ] )
101
+ * ` name ` (` unknown ` ) - field name to check (typically ` string ` )
103
102
104
103
###### Returns
105
104
106
- Whether ` node ` is has property ` name ` (` boolean ` ).
105
+ Whether ` node ` is an element that has a ` field ` property (` boolean ` ).
107
106
108
107
## Types
109
108
@@ -114,7 +113,7 @@ It exports no additional types.
114
113
115
114
Projects maintained by the unified collective are compatible with all maintained
116
115
versions of Node.js.
117
- As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18 .0+.
116
+ As of now, that is Node.js 14.14+ and 16 .0+.
118
117
Our projects sometimes work with older versions, but this is not guaranteed.
119
118
120
119
## Security
@@ -219,10 +218,8 @@ abide by its terms.
219
218
220
219
[ hast ] : https://github.com/syntax-tree/hast
221
220
222
- [ node ] : https://github.com/syntax-tree/hast#nodes
223
-
224
221
[ element ] : https://github.com/syntax-tree/hast#element
225
222
226
- [ property ] : https://github.com/syntax-tree/hast#property-names
227
-
228
223
[ xss ] : https://en.wikipedia.org/wiki/Cross-site_scripting
224
+
225
+ [ hasproperty ] : #haspropertynode-field
0 commit comments