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

Commit 02f1e48

Browse files
committed
New: Support Definite Assignment (fixes #424)
1 parent e1c6b33 commit 02f1e48

File tree

4 files changed

+951
-0
lines changed

4 files changed

+951
-0
lines changed

lib/convert.js

+8
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,10 @@ module.exports = function convert(config) {
658658
init: convertChild(node.initializer)
659659
});
660660

661+
if (node.exclamationToken) {
662+
result.exclamationToken = true;
663+
}
664+
661665
if (node.type) {
662666
result.id.typeAnnotation = convertTypeAnnotation(node.type);
663667
fixTypeAnnotationParentLocation(result.id);
@@ -859,6 +863,10 @@ module.exports = function convert(config) {
859863
result.key.optional = true;
860864
}
861865

866+
if (node.exclamationToken) {
867+
result.exclamationToken = true;
868+
}
869+
862870
if (result.key.type === AST_NODE_TYPES.Literal && node.questionToken) {
863871
result.optional = true;
864872
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class X {
2+
a!: string;
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const x!: string;
2+
var y!: number;
3+
let z!: object;

0 commit comments

Comments
 (0)