diff --git a/default_tsconfig.json b/default_tsconfig.json index b4de5c7..089091f 100644 --- a/default_tsconfig.json +++ b/default_tsconfig.json @@ -19,8 +19,10 @@ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + "skipLibCheck": true, /* Type Checking */ "strict": true /* Enable all strict type-checking options. */ - } + }, + "exclude": ["examples"] } diff --git a/src/code-generator.ts b/src/code-generator.ts index 26765cf..59f23c5 100644 --- a/src/code-generator.ts +++ b/src/code-generator.ts @@ -119,7 +119,7 @@ export default class CodeGenerator extends StringBuilder { case SyntaxKind.Identifier: { const { text } = node; const isTypeIdent = this.consumeFlag("TypeIdent"); - this.append(isTypeIdent ? this.getMappedType(text) : this.getMappedIdentifier(text)); + this.append(isTypeIdent ? this.getMappedIdentifier(text) : this.getMappedType(text)); break; } case SyntaxKind.VariableDeclaration: { @@ -1313,6 +1313,7 @@ export default class CodeGenerator extends StringBuilder { this.append(" forall "); for (const typeParam of typeParameters) { this.walk(typeParam.name); + if (Util.isNotLast(typeParam, typeParameters)) this.append(", "); } @@ -1456,6 +1457,7 @@ export default class CodeGenerator extends StringBuilder { case SyntaxKind.TypeReference: { const ref = type; const typeName = this.getMappedType(ref.typeName.getText(this.sourceNode)); + this.append(typeName); this.walkTypeArguments(ref.typeArguments); if (ref.typeArguments && typeName === "Hash") { diff --git a/src/tests/code-generator-test.ts b/src/tests/code-generator-test.ts index fa14df5..aec8bae 100644 --- a/src/tests/code-generator-test.ts +++ b/src/tests/code-generator-test.ts @@ -20,7 +20,7 @@ describe("CodeGenerator", () => { describe("should transpile literals", () => { it("basic datatypes", () => { testGenerate("69.420").should.equal("69.42"); - testGenerate("'hello world!'").should.equal('"hello world!"'); + testGenerate("'hello world!'").should.equal("'hello world!'"); testGenerate("false && true").should.equal('false && true'); }); it("arrays", () => { diff --git a/tsconfig.json b/tsconfig.json index ae15c7f..6a713ac 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,6 +19,7 @@ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + "skipLibCheck": true, /* Skip library checks. */ /* Type Checking */ "strict": true /* Enable all strict type-checking options. */