@ealmansi/jagger
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -0,5 +1,8 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Jagger = void 0; | ||
/** | ||
* | ||
*/ | ||
export class Jagger { | ||
class Jagger { | ||
/** | ||
@@ -15,1 +18,2 @@ * | ||
} | ||
exports.Jagger = Jagger; |
@@ -1,3 +0,8 @@ | ||
import ts from "typescript"; | ||
export default (program) => { | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const typescript_1 = __importDefault(require("typescript")); | ||
exports.default = (program) => { | ||
return (context) => { | ||
@@ -8,6 +13,6 @@ return (sourceFile) => { | ||
do { | ||
if (!ts.isPropertyDeclaration(node)) { | ||
if (!typescript_1.default.isPropertyDeclaration(node)) { | ||
break; | ||
} | ||
if (!ts.isIdentifier(node.name)) { | ||
if (!typescript_1.default.isIdentifier(node.name)) { | ||
break; | ||
@@ -17,11 +22,11 @@ } | ||
if (!(node.initializer !== undefined && | ||
ts.isExpressionWithTypeArguments(node.initializer))) { | ||
typescript_1.default.isExpressionWithTypeArguments(node.initializer))) { | ||
break; | ||
} | ||
const nodeInitializer = node.initializer; | ||
if (!ts.isPropertyAccessExpression(nodeInitializer.expression)) { | ||
if (!typescript_1.default.isPropertyAccessExpression(nodeInitializer.expression)) { | ||
break; | ||
} | ||
const nodeInitializerExpression = nodeInitializer.expression; | ||
if (!ts.isIdentifier(nodeInitializerExpression.expression)) { | ||
if (!typescript_1.default.isIdentifier(nodeInitializerExpression.expression)) { | ||
break; | ||
@@ -33,3 +38,3 @@ } | ||
} | ||
if (!ts.isIdentifier(nodeInitializerExpression.name)) { | ||
if (!typescript_1.default.isIdentifier(nodeInitializerExpression.name)) { | ||
break; | ||
@@ -47,7 +52,7 @@ } | ||
nodeInitializerTypeArguments[0] !== undefined && | ||
ts.isTypeReferenceNode(nodeInitializerTypeArguments[0]))) { | ||
typescript_1.default.isTypeReferenceNode(nodeInitializerTypeArguments[0]))) { | ||
break; | ||
} | ||
const nodeInitializerTypeArgument = nodeInitializerTypeArguments[0]; | ||
if (!ts.isIdentifier(nodeInitializerTypeArgument.typeName)) { | ||
if (!typescript_1.default.isIdentifier(nodeInitializerTypeArgument.typeName)) { | ||
break; | ||
@@ -67,7 +72,7 @@ } | ||
undefined && | ||
ts.isClassDeclaration(nodeInitializerTypeArgumentTypeNameSymbolDeclarations[0]))) { | ||
typescript_1.default.isClassDeclaration(nodeInitializerTypeArgumentTypeNameSymbolDeclarations[0]))) { | ||
break; | ||
} | ||
const nodeInitializerTypeArgumentTypeNameSymbolClassDeclaration = nodeInitializerTypeArgumentTypeNameSymbolDeclarations[0]; | ||
const nodeInitializerTypeArgumentTypeNameSymbolClassDeclarationConstructorDeclaration = nodeInitializerTypeArgumentTypeNameSymbolClassDeclaration.members.find(ts.isConstructorDeclaration); | ||
const nodeInitializerTypeArgumentTypeNameSymbolClassDeclarationConstructorDeclaration = nodeInitializerTypeArgumentTypeNameSymbolClassDeclaration.members.find(typescript_1.default.isConstructorDeclaration); | ||
if (nodeInitializerTypeArgumentTypeNameSymbolClassDeclarationConstructorDeclaration === | ||
@@ -80,3 +85,3 @@ undefined) { | ||
for (const { type, } of nodeInitializerTypeArgumentTypeNameSymbolClassDeclarationConstructorDeclarationParameters) { | ||
if (!(type !== undefined && ts.isTypeReferenceNode(type))) { | ||
if (!(type !== undefined && typescript_1.default.isTypeReferenceNode(type))) { | ||
break; | ||
@@ -88,3 +93,3 @@ } | ||
for (const { typeName, } of nodeInitializerTypeArgumentTypeNameSymbolClassDeclarationConstructorDeclarationParametersTypes) { | ||
if (!ts.isIdentifier(typeName)) { | ||
if (!typescript_1.default.isIdentifier(typeName)) { | ||
break; | ||
@@ -98,7 +103,7 @@ } | ||
} while (false); | ||
return ts.visitEachChild(node, visitor, context); | ||
return typescript_1.default.visitEachChild(node, visitor, context); | ||
}; | ||
return ts.visitNode(sourceFile, visitor); | ||
return typescript_1.default.visitNode(sourceFile, visitor); | ||
}; | ||
}; | ||
}; |
{ | ||
"name": "@ealmansi/jagger", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "WIP", | ||
@@ -5,0 +5,0 @@ "type": "module", |
9967
132