1717* [ Install] ( #install )
1818* [ Use] ( #use )
1919* [ API] ( #api )
20- * [ ` name(value) ` ] ( #namevalue )
21- * [ ` start(code) ` ] ( #startcode )
2220 * [ ` cont(code) ` ] ( #contcode )
21+ * [ ` name(name) ` ] ( #namename )
22+ * [ ` start(code) ` ] ( #startcode )
2323* [ Types] ( #types )
2424* [ Compatibility] ( #compatibility )
2525* [ Related] ( #related )
@@ -39,7 +39,7 @@ You can use this utility when generating IDs from strings or parsing IDs.
3939## Install
4040
4141This package is [ ESM only] [ esm ] .
42- In Node.js (version 12.20+, 14.14+, 16.0+, or 18 .0+), install with [ npm] [ ] :
42+ In Node.js (version 14.14+ and 16 .0+), install with [ npm] [ ] :
4343
4444``` sh
4545npm install estree-util-is-identifier-name
@@ -62,7 +62,7 @@ In browsers with [`esm.sh`][esmsh]:
6262## Use
6363
6464``` js
65- import {name , start , cont } from ' estree-util-is-identifier-name'
65+ import {cont , name , start } from ' estree-util-is-identifier-name'
6666
6767name (' $something69' ) // => true
6868name (' 69' ) // => false
@@ -74,22 +74,48 @@ cont(48) // => true (character code for `0`)
7474
7575## API
7676
77- This package exports the identifiers ` name ` , ` start ` , and ` cont ` .
77+ This package exports the identifiers [ ` cont ` ] [ cont ] , [ ` name ` ] [ name ] , and
78+ [ ` start ` ] [ start ] .
7879There is no default export.
7980
80- ### ` name(value) `
81+ ### ` cont(code) `
82+
83+ Checks if the given character code can continue an identifier.
84+
85+ ###### Parameters
86+
87+ * ` code ` (` number ` )
88+ — character code to check
89+
90+ ###### Returns
91+
92+ Whether ` code ` can continue an identifier (` boolean ` ).
93+
94+ ### ` name(name) `
95+
96+ Checks if the given value is a valid identifier name.
8197
82- Checks if ` value ` (` string ` ) is a valid identifier name (` boolean ` ).
98+ ###### Parameters
99+
100+ * ` name ` (` string ` )
101+ — identifier to check
102+
103+ ###### Returns
104+
105+ Whether ` name ` can be an identifier (` boolean ` ).
83106
84107### ` start(code) `
85108
86- Checks if the given character code (` number ` ) can start an identifier
87- (` boolean ` ).
109+ Checks if the given character code can start an identifier.
88110
89- ### ` cont(code) `
111+ ###### Parameters
112+
113+ * ` code ` (` number ` )
114+ — character code to check
90115
91- Checks if the given character code (` number ` ) can continue an identifier
92- (` boolean ` ).
116+ ###### Returns
117+
118+ Whether ` code ` can start an identifier (` boolean ` ).
93119
94120## Types
95121
@@ -100,7 +126,7 @@ It exports no additional types.
100126
101127Projects maintained by the unified collective are compatible with all maintained
102128versions of Node.js.
103- As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18 .0+.
129+ As of now, that is Node.js 14.14+ and 16 .0+.
104130Our projects sometimes work with older versions, but this is not guaranteed.
105131
106132## Related
@@ -171,3 +197,9 @@ abide by its terms.
171197[ coc ] : https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md
172198
173199[ estree ] : https://github.com/estree/estree
200+
201+ [ cont ] : #contcode
202+
203+ [ name ] : #namename
204+
205+ [ start ] : #startcode
0 commit comments