detective-typescript
Advanced tools
Comparing version 5.4.0 to 5.5.0
14
index.js
@@ -13,5 +13,13 @@ 'use strict'; | ||
module.exports = function(src, options = {}) { | ||
options.parser = Parser; | ||
const walker = new Walker(options); | ||
const walkerOptions = Object.assign({}, options, {parser: Parser}); | ||
// Determine whether to skip "type-only" imports | ||
// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html#import-types | ||
const skipTypeImports = Boolean(options.skipTypeImports); | ||
// Remove skipTypeImports option, as this option may not be recognized by the walker/parser | ||
delete walkerOptions.skipTypeImports; | ||
const walker = new Walker(walkerOptions); | ||
const dependencies = []; | ||
@@ -51,3 +59,3 @@ | ||
case 'TSImportType': | ||
if (node.parameter.type === 'TSLiteralType') { | ||
if (!skipTypeImports && node.parameter.type === 'TSLiteralType') { | ||
dependencies.push(node.parameter.literal.value); | ||
@@ -54,0 +62,0 @@ } |
{ | ||
"name": "detective-typescript", | ||
"version": "5.4.0", | ||
"version": "5.5.0", | ||
"author": "Patrik Henningsson <patrik.henningsson@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "Get the dependencies of a TypeScript module", |
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
3993
61