Having an issue with the JS code that TypeScript compiler is generating. Here's an example class:
// Class
export class UserDTO {
Id: number;
FirstName: string;
LastName: string;
DateOfBirth: Date;
getFullName(): string {
return this.FirstName + ' ' + this.LastName;
}
}
The TypeScript output looks like this:
define(["require", "exports"], function(require, exports) {
// Class
var UserDTO = (function () {
function UserDTO() {
}
UserDTO.prototype.getFullName = function () {
return this.FirstName + ' ' + this.LastName;
};
return UserDTO;
})();
exports.UserDTO = UserDTO;
});
//@ sourceMappingURL=TestClass.js.map
This code doesn't include unused fields which I need for certain object-to-object mapping scenarios. Is there a way to always force the compiler to generate them?
Currently using TypeScript 0.9.1 with Visual Studio 2012, and here are my compiler options:
<TypeScriptTarget>ES5</TypeScriptTarget>
<TypeScriptIncludeComments>true</TypeScriptIncludeComments>
<TypeScriptSourceMap>true</TypeScriptSourceMap>
<TypeScriptModuleKind>AMD</TypeScriptModuleKind>
Appreciate any suggestions or tips in advance.