Comparing version 0.1.0 to 0.1.1
@@ -60,7 +60,8 @@ "use strict"; | ||
var typeRef = param.type; | ||
// Type reference can be a bare name or a qualified name (foo.bar). | ||
// There are also type arguments to worry about. We are making the | ||
// big assumption that a type reference is the same name as a ctor | ||
// for that type, and it's simplest to just use the source text. | ||
paramCtor = typeRef.getText(); | ||
// Type reference can be a bare name or a qualified name (foo.bar), | ||
// possibly followed by type arguments (<X, Y>). | ||
// We are making the assumption that a type reference is the same | ||
// name as a ctor for that type, and it's simplest to just use the | ||
// source text. We use `typeName` to avoid emitting type parameters. | ||
paramCtor = typeRef.typeName.getText(); | ||
break; | ||
@@ -67,0 +68,0 @@ default: |
{ | ||
"name": "tsickle", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Transpile TypeScript code to JavaScript with Closure annotations.", | ||
@@ -5,0 +5,0 @@ "main": "build/src/tsickle.js", |
@@ -57,7 +57,8 @@ import * as ts from 'typescript'; | ||
let typeRef = param.type as ts.TypeReferenceNode; | ||
// Type reference can be a bare name or a qualified name (foo.bar). | ||
// There are also type arguments to worry about. We are making the | ||
// big assumption that a type reference is the same name as a ctor | ||
// for that type, and it's simplest to just use the source text. | ||
paramCtor = typeRef.getText(); | ||
// Type reference can be a bare name or a qualified name (foo.bar), | ||
// possibly followed by type arguments (<X, Y>). | ||
// We are making the assumption that a type reference is the same | ||
// name as a ctor for that type, and it's simplest to just use the | ||
// source text. We use `typeName` to avoid emitting type parameters. | ||
paramCtor = typeRef.typeName.getText(); | ||
break; | ||
@@ -64,0 +65,0 @@ default: |
@@ -205,2 +205,17 @@ import * as ts from 'typescript'; | ||
}); | ||
it('strips generic type arguments', () => { | ||
expect(translate(` | ||
class Foo { | ||
constructor(@Inject typed: Promise<string>) { | ||
} | ||
}`).output).to.equal(` | ||
class Foo { | ||
constructor( typed: Promise<string>) { | ||
} | ||
static ctorParameters: {type: Function, decorators?: DecoratorInvocation[]}[] = [ | ||
{type: Promise, decorators: [{ type: Inject }, ]}, | ||
]; | ||
}`); | ||
}); | ||
}); | ||
@@ -207,0 +222,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
364623
122
6207