Skip to content

Commit

Permalink
Default undefined compiler options to the default values from the met…
Browse files Browse the repository at this point in the history
…eor-typescript NPM.
  • Loading branch information
barbatus committed Mar 27, 2016
1 parent 36bf621 commit 0101e89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
name: 'barbatus:typescript-compiler',
version: '0.5.0-beta.13',
version: '0.5.0-beta.14',
summary: 'TypeScript Compiler for Meteor',
git: 'https://github.com/barbatus/ts-compilers',
documentation: 'README.md'
Expand Down
14 changes: 7 additions & 7 deletions typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ TypeScript = {
getDefaultOptions: meteorTS.getDefaultOptions,

getCompilerOptions(compilerOptions, extraOptions) {
let resultOptions = compilerOptions ? _.clone(compilerOptions) :
meteorTS.getDefaultOptions().compilerOptions;
let dco = meteorTS.getDefaultOptions().compilerOptions;
let resultOptions = compilerOptions ? _.clone(compilerOptions) : dco;

// If diagnostics no defined, set it to true.
_.defaults(resultOptions, {
module: 'commonjs',
diagnostics: true
});
// First, default undefined values, e.g.,
// if diagnostics undefined, set it to true, etc.
_.defaults(resultOptions, dco);

// Second, apply extra options, i.e.,
// options passed in the compiler constructor.
_.extend(resultOptions, extraOptions);

return resultOptions;
Expand Down

0 comments on commit 0101e89

Please sign in to comment.