Skip to content

Commit

Permalink
Merge pull request #410 from johnnyreilly/master
Browse files Browse the repository at this point in the history
remove arrify dependency
  • Loading branch information
johnnyreilly authored Dec 10, 2016
2 parents ba72e7e + 3a9cd2b commit b5062db
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
},
"homepage": "https://github.com/TypeStrong/ts-loader",
"dependencies": {
"arrify": "^1.0.0",
"colors": "^1.0.3",
"enhanced-resolve": "^0.9.0",
"loader-utils": "^0.2.6",
Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import path = require('path');
import loaderUtils = require('loader-utils');
import objectAssign = require('object-assign');
import arrify = require('arrify');
require('colors');

import instances = require('./instances');
Expand Down Expand Up @@ -65,7 +64,7 @@ function makeOptions(loader: interfaces.Webpack) {
appendTsSuffixTo: [],
entryFileIsJs: false,
}, configFileOptions, queryOptions);
options.ignoreDiagnostics = arrify(options.ignoreDiagnostics).map(Number);
options.ignoreDiagnostics = utils.arrify(options.ignoreDiagnostics).map(Number);
options.logLevel = options.logLevel.toUpperCase();

// differentiate the TypeScript instance based on the webpack instance
Expand Down
5 changes: 0 additions & 5 deletions src/typings/arrify/arrify.d.ts

This file was deleted.

8 changes: 8 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,11 @@ export function collectAllDependencies(
}
return Object.keys(result);
}

export function arrify<T>(val: T | T[]) {
if (val === null || val === undefined) {
return [];
}

return Array.isArray(val) ? val : [val];
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Module build failed: Error: Typescript emitted no output for node_modules\a\inde
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358
at Object.loader (dist\index.js:30:15)
at Object.loader (dist\index.js:29:15)
@ ./.test/nodeModulesMeaningfulErrorWhenImportingTs/app.ts 2:8-20
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Module build failed: Error: Typescript emitted no output for node_modules\a\inde
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358
at Object.loader (dist\index.js:30:15)
at Object.loader (dist\index.js:29:15)
@ ./.test/nodeModulesMeaningfulErrorWhenImportingTs/app.ts 2:8-20

0 comments on commit b5062db

Please sign in to comment.