typescript-is
Advanced tools
Comparing version 0.12.0 to 0.12.1
@@ -35,6 +35,8 @@ "use strict"; | ||
if ('valueDeclaration' in symbol) { | ||
if (!ts.isPropertySignature(symbol.valueDeclaration) && !ts.isMethodSignature(symbol.valueDeclaration)) { | ||
throw new Error('Unsupported declaration kind: ' + symbol.valueDeclaration.kind); | ||
const valueDeclaration = symbol.valueDeclaration; | ||
if (!ts.isPropertySignature(valueDeclaration) && !ts.isMethodSignature(valueDeclaration)) { | ||
throw new Error('Unsupported declaration kind: ' + valueDeclaration.kind); | ||
} | ||
const isMethod = ts.isMethodSignature(symbol.valueDeclaration); | ||
const isMethod = ts.isMethodSignature(valueDeclaration) | ||
|| valueDeclaration.type !== undefined && ts.isFunctionTypeNode(valueDeclaration.type); | ||
if (isMethod && !visitorContext.options.ignoreMethods) { | ||
@@ -44,3 +46,3 @@ throw new Error('Encountered a method declaration, but methods are not supported. Issue: https://github.com/woutervh-/typescript-is/issues/5'); | ||
let propertyType = undefined; | ||
if (symbol.valueDeclaration.type === undefined) { | ||
if (valueDeclaration.type === undefined) { | ||
if (!isMethod) { | ||
@@ -51,3 +53,3 @@ throw new Error('Found property without type.'); | ||
else { | ||
propertyType = visitorContext.checker.getTypeFromTypeNode(symbol.valueDeclaration.type); | ||
propertyType = visitorContext.checker.getTypeFromTypeNode(valueDeclaration.type); | ||
} | ||
@@ -59,3 +61,3 @@ return { | ||
isSymbol: name.startsWith('__@'), | ||
optional: !!symbol.valueDeclaration.questionToken | ||
optional: !!valueDeclaration.questionToken | ||
}; | ||
@@ -62,0 +64,0 @@ } |
@@ -5,3 +5,2 @@ "use strict"; | ||
const path = require("path"); | ||
const visitor_1 = require("./visitor"); | ||
const compiler_1 = require("./compiler"); | ||
@@ -55,5 +54,6 @@ function transformer(program, options) { | ||
&& node.typeArguments.length === 1) { | ||
const typeArgument = node.typeArguments[0]; | ||
const accessor = node.arguments[0]; | ||
return visitor_1.visitTypeNode(typeArgument, accessor, Object.assign({}, visitorContext, { typeCheckFunctionAccessorTopLevel: node.expression })); | ||
// const typeArgument = node.typeArguments[0]; | ||
// const accessor = node.arguments[0]; | ||
// return visitTypeNode(typeArgument, accessor, { ...visitorContext, typeCheckFunctionAccessorTopLevel: node.expression }); | ||
return node; | ||
} | ||
@@ -60,0 +60,0 @@ } |
{ | ||
"name": "typescript-is", | ||
"version": "0.12.0", | ||
"version": "0.12.1", | ||
"engines": { | ||
@@ -37,3 +37,3 @@ "node": ">=6.14.4" | ||
"nested-error-stacks": "^2", | ||
"tsutils": "^3" | ||
"tsutils": "^3.14.0" | ||
}, | ||
@@ -57,4 +57,4 @@ "optionalDependencies": { | ||
"ttypescript": "^1.5.5", | ||
"typescript": "^3" | ||
"typescript": "^3.5.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
198484
43
2407
Updatedtsutils@^3.14.0