Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typescript-is

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typescript-is - npm Package Compare versions

Comparing version 0.12.0 to 0.12.1

14

lib/transform-inline/visitor-utils.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc