You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Enhancement: Add ESM distribution, with module property in package.json
- Refactoring: Add Rollup/Babel/Terser
- Build: Have generator file produce consumable source files directly rather than logging to console
- Linting: Switch from JSHint to ESLint (using rules, e.g., `indent` and `prefer-const`, in place on other estools project)
- Testing: Convert coffeescript test files to ES6
- Testing: Add nyc
- Testing: Check unmatched high surrogates and full coverage for AST
expressions (further true `isExpression` and `isStatement`'s and
false `isProblematicIfStatement`), bringing to 100% coverage
- Travis: Drop previous versions for 10, 12, 14
- Docs: Use heading nesting consistently; rmv trailing spaces
Copy file name to clipboardexpand all lines: README.md
+35-35
Original file line number
Diff line number
Diff line change
@@ -4,29 +4,29 @@ utility box for ECMAScript language tools.
4
4
5
5
## API
6
6
7
-
## `ast`
7
+
## `ast`
8
8
9
-
### `ast.isExpression(node)`
9
+
### `ast.isExpression(node)`
10
10
11
11
Returns `true` if `node` is an `Expression` as defined in ECMA262 edition 5.1 section
12
12
[11](https://es5.github.io/#x11).
13
13
14
-
### `ast.isStatement(node)`
14
+
### `ast.isStatement(node)`
15
15
16
16
Returns `true` if `node` is a `Statement` as defined in ECMA262 edition 5.1 section
17
17
[12](https://es5.github.io/#x12).
18
18
19
-
### `ast.isIterationStatement(node)`
19
+
### `ast.isIterationStatement(node)`
20
20
21
21
Returns `true` if `node` is an `IterationStatement` as defined in ECMA262 edition
22
22
5.1 section [12.6](https://es5.github.io/#x12.6).
23
23
24
-
### `ast.isSourceElement(node)`
24
+
### `ast.isSourceElement(node)`
25
25
26
26
Returns `true` if `node` is a `SourceElement` as defined in ECMA262 edition 5.1
27
27
section [14](https://es5.github.io/#x14).
28
28
29
-
### `ast.trailingStatement(node)`
29
+
### `ast.trailingStatement(node)`
30
30
31
31
Returns `Statement?` if `node` has trailing `Statement`.
32
32
```js
@@ -35,7 +35,7 @@ if (cond)
35
35
```
36
36
When taking this `IfStatement`, returns `consequent;` statement.
37
37
38
-
### `ast.isProblematicIfStatement(node)`
38
+
### `ast.isProblematicIfStatement(node)`
39
39
40
40
Returns `true` if `node` is a problematic `IfStatement`. If `node` is a problematic `IfStatement`, `node` cannot be represented as an one-to-one JavaScript code.
41
41
```js
@@ -54,101 +54,101 @@ Returns `true` if `node` is a problematic `IfStatement`. If `node` is a problema
54
54
The above node cannot be represented as a JavaScript code, since the top level `else` alternate belongs to an inner `IfStatement`.
55
55
56
56
57
-
## `code`
57
+
## `code`
58
58
59
-
### `code.isDecimalDigit(code)`
59
+
### `code.isDecimalDigit(code)`
60
60
61
61
Return `true` if provided code is decimal digit.
62
62
63
-
### `code.isHexDigit(code)`
63
+
### `code.isHexDigit(code)`
64
64
65
65
Return `true` if provided code is hexadecimal digit.
66
66
67
-
### `code.isOctalDigit(code)`
67
+
### `code.isOctalDigit(code)`
68
68
69
69
Return `true` if provided code is octal digit.
70
70
71
-
### `code.isWhiteSpace(code)`
71
+
### `code.isWhiteSpace(code)`
72
72
73
-
Return `true` if provided code is white space.
73
+
Return `true` if provided code is white space.
74
74
White space characters are formally defined in ECMA262.
75
75
76
-
### `code.isLineTerminator(code)`
76
+
### `code.isLineTerminator(code)`
77
77
78
-
Return `true` if provided code is line terminator.
78
+
Return `true` if provided code is line terminator.
79
79
Line terminator characters are formally defined in ECMA262.
80
80
81
-
### `code.isIdentifierStart(code)`
81
+
### `code.isIdentifierStart(code)`
82
82
83
-
Return `true` if provided code can be the first character of ECMA262 `Identifier`.
83
+
Return `true` if provided code can be the first character of ECMA262 `Identifier`.
84
84
They are formally defined in ECMA262.
85
85
86
-
### `code.isIdentifierPart(code)`
86
+
### `code.isIdentifierPart(code)`
87
87
88
-
Return `true` if provided code can be the trailing character of ECMA262 `Identifier`.
88
+
Return `true` if provided code can be the trailing character of ECMA262 `Identifier`.
89
89
They are formally defined in ECMA262.
90
90
91
-
## `keyword`
91
+
## `keyword`
92
92
93
-
### `keyword.isKeywordES5(id, strict)`
93
+
### `keyword.isKeywordES5(id, strict)`
94
94
95
95
Returns `true` if provided identifier string is a Keyword or Future Reserved Word
96
-
in ECMA262 edition 5.1.
96
+
in ECMA262 edition 5.1.
97
97
They are formally defined in ECMA262 sections
98
98
[7.6.1.1](http://es5.github.io/#x7.6.1.1) and [7.6.1.2](http://es5.github.io/#x7.6.1.2),
99
-
respectively.
99
+
respectively.
100
100
If the `strict` flag is truthy, this function additionally checks whether
101
101
`id` is a `Keyword` or `FutureReservedWord` under strict mode.
102
102
103
-
### `keyword.isKeywordES6(id, strict)`
103
+
### `keyword.isKeywordES6(id, strict)`
104
104
105
105
Returns `true` if provided identifier string is a `Keyword` or `FutureReservedWord`
106
-
in ECMA262 edition 6.
106
+
in ECMA262 edition 6.
107
107
They are formally defined in ECMA262 sections
108
108
[11.6.2.1](http://ecma-international.org/ecma-262/6.0/#sec-keywords) and
0 commit comments