Fix typo in babel-types doc script + run it (#5855)
This commit is contained in:
parent
58ec149c52
commit
003b8918c2
@ -321,7 +321,7 @@ See also `t.isClassMethod(node, opts)` and `t.assertClassMethod(node, opts)`.
|
|||||||
Aliases: `Function`, `Scopable`, `BlockParent`, `FunctionParent`, `Method`
|
Aliases: `Function`, `Scopable`, `BlockParent`, `FunctionParent`, `Method`
|
||||||
|
|
||||||
- `kind`: `"get" | "set" | "method" | "constructor"` (default: `'method'`)
|
- `kind`: `"get" | "set" | "method" | "constructor"` (default: `'method'`)
|
||||||
- `key`if computed then `Expression` else `Identifier | Literal` (required)
|
- `key`: if computed then `Expression` else `Identifier | Literal` (required)
|
||||||
- `params`: `Array<LVal>` (required)
|
- `params`: `Array<LVal>` (required)
|
||||||
- `body`: `BlockStatement` (required)
|
- `body`: `BlockStatement` (required)
|
||||||
- `computed`: `boolean` (default: `false`)
|
- `computed`: `boolean` (default: `false`)
|
||||||
@ -407,6 +407,34 @@ Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### declareExportAllDeclaration
|
||||||
|
```javascript
|
||||||
|
t.declareExportAllDeclaration(source)
|
||||||
|
```
|
||||||
|
|
||||||
|
See also `t.isDeclareExportAllDeclaration(node, opts)` and `t.assertDeclareExportAllDeclaration(node, opts)`.
|
||||||
|
|
||||||
|
Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
|
||||||
|
|
||||||
|
- `source` (required)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### declareExportDeclaration
|
||||||
|
```javascript
|
||||||
|
t.declareExportDeclaration(declaration, specifiers, source)
|
||||||
|
```
|
||||||
|
|
||||||
|
See also `t.isDeclareExportDeclaration(node, opts)` and `t.assertDeclareExportDeclaration(node, opts)`.
|
||||||
|
|
||||||
|
Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
|
||||||
|
|
||||||
|
- `declaration` (required)
|
||||||
|
- `specifiers` (required)
|
||||||
|
- `source` (required)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### declareFunction
|
### declareFunction
|
||||||
```javascript
|
```javascript
|
||||||
t.declareFunction(id)
|
t.declareFunction(id)
|
||||||
@ -832,7 +860,7 @@ See also `t.isIdentifier(node, opts)` and `t.assertIdentifier(node, opts)`.
|
|||||||
|
|
||||||
Aliases: `Expression`, `LVal`
|
Aliases: `Expression`, `LVal`
|
||||||
|
|
||||||
- `name``string` (required)
|
- `name`: `string` (required)
|
||||||
- `decorators`: `Array<Decorator>` (default: `null`)
|
- `decorators`: `Array<Decorator>` (default: `null`)
|
||||||
- `typeAnnotation` (default: `null`)
|
- `typeAnnotation` (default: `null`)
|
||||||
|
|
||||||
@ -1165,7 +1193,7 @@ See also `t.isMemberExpression(node, opts)` and `t.assertMemberExpression(node,
|
|||||||
Aliases: `Expression`, `LVal`
|
Aliases: `Expression`, `LVal`
|
||||||
|
|
||||||
- `object`: `Expression` (required)
|
- `object`: `Expression` (required)
|
||||||
- `property`if computed then `Expression` else `Identifier` (required)
|
- `property`: if computed then `Expression` else `Identifier` (required)
|
||||||
- `computed`: `boolean` (default: `false`)
|
- `computed`: `boolean` (default: `false`)
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -1317,7 +1345,7 @@ See also `t.isObjectMethod(node, opts)` and `t.assertObjectMethod(node, opts)`.
|
|||||||
Aliases: `UserWhitespacable`, `Function`, `Scopable`, `BlockParent`, `FunctionParent`, `Method`, `ObjectMember`
|
Aliases: `UserWhitespacable`, `Function`, `Scopable`, `BlockParent`, `FunctionParent`, `Method`, `ObjectMember`
|
||||||
|
|
||||||
- `kind`: `"method" | "get" | "set"` (default: `'method'`)
|
- `kind`: `"method" | "get" | "set"` (default: `'method'`)
|
||||||
- `key`if computed then `Expression` else `Identifier | Literal` (required)
|
- `key`: if computed then `Expression` else `Identifier | Literal` (required)
|
||||||
- `params` (required)
|
- `params` (required)
|
||||||
- `body`: `BlockStatement` (required)
|
- `body`: `BlockStatement` (required)
|
||||||
- `computed`: `boolean` (default: `false`)
|
- `computed`: `boolean` (default: `false`)
|
||||||
@ -1353,7 +1381,7 @@ See also `t.isObjectProperty(node, opts)` and `t.assertObjectProperty(node, opts
|
|||||||
|
|
||||||
Aliases: `UserWhitespacable`, `Property`, `ObjectMember`
|
Aliases: `UserWhitespacable`, `Property`, `ObjectMember`
|
||||||
|
|
||||||
- `key`if computed then `Expression` else `Identifier | Literal` (required)
|
- `key`: if computed then `Expression` else `Identifier | Literal` (required)
|
||||||
- `value`: `Expression | Pattern | RestElement` (required)
|
- `value`: `Expression | Pattern | RestElement` (required)
|
||||||
- `computed`: `boolean` (default: `false`)
|
- `computed`: `boolean` (default: `false`)
|
||||||
- `shorthand`: `boolean` (default: `false`)
|
- `shorthand`: `boolean` (default: `false`)
|
||||||
|
|||||||
@ -118,7 +118,7 @@ Object.keys(types.BUILDER_KEYS).sort().forEach(function(key) {
|
|||||||
const fieldDescription = ["`" + field + "`"];
|
const fieldDescription = ["`" + field + "`"];
|
||||||
const validator = types.NODE_FIELDS[key][field].validate;
|
const validator = types.NODE_FIELDS[key][field].validate;
|
||||||
if (customTypes[key] && customTypes[key][field]) {
|
if (customTypes[key] && customTypes[key][field]) {
|
||||||
fieldDescription.push(customTypes[key][field]);
|
fieldDescription.push(`: ${customTypes[key][field]}`);
|
||||||
} else if (validator) {
|
} else if (validator) {
|
||||||
try {
|
try {
|
||||||
fieldDescription.push(": `" + getType(validator) + "`");
|
fieldDescription.push(": `" + getType(validator) + "`");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user