Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit 2d09fb1

Browse files
committed
Add labels for accessiblity, export, and static
1 parent a361063 commit 2d09fb1

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

lib/convert.js

+16-3
Original file line numberDiff line numberDiff line change
@@ -1728,7 +1728,11 @@ module.exports = function convert(config) {
17281728
computed: nodeUtils.isComputedProperty(node.name),
17291729
key: convertChild(node.name),
17301730
params: node.parameters.map(parameter => convertChild(parameter)),
1731-
typeAnnotation: (node.type) ? convertTypeAnnotation(node.type) : null
1731+
typeAnnotation: (node.type) ? convertTypeAnnotation(node.type) : null,
1732+
accessibility: nodeUtils.getTSNodeAccessibility(node),
1733+
readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node),
1734+
static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node),
1735+
export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node)
17321736
});
17331737

17341738
if (node.typeParameters) {
@@ -1744,7 +1748,12 @@ module.exports = function convert(config) {
17441748
optional: nodeUtils.isOptional(node),
17451749
computed: nodeUtils.isComputedProperty(node.name),
17461750
key: convertChild(node.name),
1747-
typeAnnotation: (node.type) ? convertTypeAnnotation(node.type) : null
1751+
typeAnnotation: (node.type) ? convertTypeAnnotation(node.type) : null,
1752+
initializer: convertChild(node.initializer),
1753+
accessibility: nodeUtils.getTSNodeAccessibility(node),
1754+
readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node),
1755+
static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node),
1756+
export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node)
17481757
});
17491758

17501759
break;
@@ -1754,7 +1763,11 @@ module.exports = function convert(config) {
17541763
Object.assign(result, {
17551764
type: AST_NODE_TYPES.TSIndexSignature,
17561765
index: convertChild(node.parameters[0]),
1757-
typeAnnotation: (node.type) ? convertTypeAnnotation(node.type) : null
1766+
typeAnnotation: (node.type) ? convertTypeAnnotation(node.type) : null,
1767+
accessibility: nodeUtils.getTSNodeAccessibility(node),
1768+
readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node),
1769+
static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node),
1770+
export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node)
17581771
});
17591772

17601773
break;

0 commit comments

Comments
 (0)