@clawject/di
Advanced tools
Comparing version 1.0.5 to 1.0.6
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.processImplicitComponents = void 0; | ||
const typescript_1 = require("typescript"); | ||
const isLifecycleMethodBean_1 = require("../ts/predicates/isLifecycleMethodBean"); | ||
@@ -31,3 +30,3 @@ const isDecoratorFromLibrary_1 = require("../decorator-processor/isDecoratorFromLibrary"); | ||
} | ||
return typescript_1.factory.updateClassDeclaration(node, node.modifiers, node.name, node.typeParameters, node.heritageClauses, [ | ||
return Context_1.Context.factory.updateClassDeclaration(node, node.modifiers, node.name, node.typeParameters, node.heritageClauses, [ | ||
...newMembers, | ||
@@ -34,0 +33,0 @@ (0, getImplicitComponentStaticInitBlock_1.getImplicitComponentStaticInitBlock)(component), |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getLazyExpressionValue = void 0; | ||
const typescript_1 = __importStar(require("typescript")); | ||
const extractDecoratorMetadata_1 = require("../decorator-processor/extractDecoratorMetadata"); | ||
const DecoratorKind_1 = require("../decorator-processor/DecoratorKind"); | ||
const Context_1 = require("../../compilation-context/Context"); | ||
const getLazyExpressionValue = (node) => { | ||
const decoratorMetadata = (0, extractDecoratorMetadata_1.extractDecoratorMetadata)(node, DecoratorKind_1.DecoratorKind.Lazy); | ||
if (decoratorMetadata === null) { | ||
return typescript_1.factory.createNull(); | ||
return Context_1.Context.factory.createNull(); | ||
} | ||
if (decoratorMetadata.args.length === 0) { | ||
return typescript_1.default.factory.createTrue(); | ||
return Context_1.Context.factory.createTrue(); | ||
} | ||
@@ -38,0 +15,0 @@ return decoratorMetadata.args[0]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DeclarationMetadataBuilder = void 0; | ||
const typescript_1 = require("typescript"); | ||
const DeclarationMetadata_1 = require("./DeclarationMetadata"); | ||
@@ -10,2 +9,3 @@ const CompileTimeElement_1 = require("./CompileTimeElement"); | ||
const mapSetToArray_1 = require("../utils/mapSetToArray"); | ||
const Context_1 = require("../../compilation-context/Context"); | ||
class DeclarationMetadataBuilder { | ||
@@ -36,3 +36,3 @@ static buildForConfiguration(configuration) { | ||
}; | ||
const property = typescript_1.factory.createPropertyDeclaration(undefined, typescript_1.factory.createPrivateIdentifier(CompileTimeElement_1.CompileTimeElement.COMPILE_TIME_METADATA), undefined, (0, valueToASTType_1.valueToASTType)(metadata), undefined); | ||
const property = Context_1.Context.factory.createPropertyDeclaration(undefined, Context_1.Context.factory.createPrivateIdentifier(CompileTimeElement_1.CompileTimeElement.COMPILE_TIME_METADATA), undefined, (0, valueToASTType_1.valueToASTType)(metadata), undefined); | ||
return (0, addDoNotEditComment_1.addDoNotEditComment)(property, addDoNotEditComment_1.DoNotEditElement.FIELD); | ||
@@ -39,0 +39,0 @@ } |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DeclarationMetadataParser = void 0; | ||
const typescript_1 = __importStar(require("typescript")); | ||
const CompileTimeElement_1 = require("./CompileTimeElement"); | ||
const CorruptedMetadataError_1 = require("../../compilation-context/messages/errors/CorruptedMetadataError"); | ||
const Context_1 = require("../../compilation-context/Context"); | ||
class DeclarationMetadataParser { | ||
@@ -34,3 +11,3 @@ static parse(classDeclaration) { | ||
var _a; | ||
if (!typescript_1.default.isPropertyDeclaration(it)) { | ||
if (!Context_1.Context.ts.isPropertyDeclaration(it)) { | ||
return false; | ||
@@ -44,3 +21,3 @@ } | ||
const declarationTypeNode = metadataProperty.type; | ||
if (!declarationTypeNode || !typescript_1.default.isTypeLiteralNode(declarationTypeNode)) { | ||
if (!declarationTypeNode || !Context_1.Context.ts.isTypeLiteralNode(declarationTypeNode)) { | ||
return new CorruptedMetadataError_1.CorruptedMetadataError('Compiled metadata property must have type literal node.', classDeclaration, null, null); | ||
@@ -52,26 +29,26 @@ } | ||
switch (true) { | ||
case typescript_1.default.isTypeLiteralNode(node): { | ||
case Context_1.Context.ts.isTypeLiteralNode(node): { | ||
const typedNode = node; | ||
return typedNode.members.filter(typescript_1.default.isPropertySignature).reduce((acc, member) => { | ||
return typedNode.members.filter(Context_1.Context.ts.isPropertySignature).reduce((acc, member) => { | ||
var _a, _b, _c; | ||
acc[(_b = (_a = member.name) === null || _a === void 0 ? void 0 : _a.getText()) !== null && _b !== void 0 ? _b : ''] = this.parseTypeNode((_c = member.type) !== null && _c !== void 0 ? _c : typescript_1.factory.createKeywordTypeNode(typescript_1.SyntaxKind.UnknownKeyword)); | ||
acc[(_b = (_a = member.name) === null || _a === void 0 ? void 0 : _a.getText()) !== null && _b !== void 0 ? _b : ''] = this.parseTypeNode((_c = member.type) !== null && _c !== void 0 ? _c : Context_1.Context.factory.createKeywordTypeNode(Context_1.Context.ts.SyntaxKind.UnknownKeyword)); | ||
return acc; | ||
}, {}); | ||
} | ||
case typescript_1.default.isTupleTypeNode(node): { | ||
case Context_1.Context.ts.isTupleTypeNode(node): { | ||
const typedNode = node; | ||
return typedNode.elements.map(it => this.parseTypeNode(it)); | ||
} | ||
case typescript_1.default.isLiteralTypeNode(node): { | ||
case Context_1.Context.ts.isLiteralTypeNode(node): { | ||
const typedNode = node; | ||
switch (typedNode.literal.kind) { | ||
case typescript_1.default.SyntaxKind.NullKeyword: | ||
case Context_1.Context.ts.SyntaxKind.NullKeyword: | ||
return null; | ||
case typescript_1.default.SyntaxKind.TrueKeyword: | ||
case Context_1.Context.ts.SyntaxKind.TrueKeyword: | ||
return true; | ||
case typescript_1.default.SyntaxKind.FalseKeyword: | ||
case Context_1.Context.ts.SyntaxKind.FalseKeyword: | ||
return false; | ||
case typescript_1.default.SyntaxKind.StringLiteral: | ||
case Context_1.Context.ts.SyntaxKind.StringLiteral: | ||
return typedNode.literal.text; | ||
case typescript_1.default.SyntaxKind.NumericLiteral: | ||
case Context_1.Context.ts.SyntaxKind.NumericLiteral: | ||
return Number(typedNode.literal.text); | ||
@@ -78,0 +55,0 @@ default: |
@@ -7,5 +7,5 @@ "use strict"; | ||
exports.InternalsAccessBuilder = exports.InternalElementKind = void 0; | ||
const typescript_1 = require("typescript"); | ||
const upath_1 = __importDefault(require("upath")); | ||
const constants_1 = require("../../../constants"); | ||
const Context_1 = require("../../compilation-context/Context"); | ||
var InternalElementKind; | ||
@@ -28,8 +28,8 @@ (function (InternalElementKind) { | ||
const importSpecifierPath = upath_1.default.join(constants_1.CONSTANTS.libraryName, 'runtime/___internal___'); | ||
return typescript_1.factory.createImportDeclaration(undefined, typescript_1.factory.createImportClause(false, undefined, typescript_1.factory.createNamespaceImport(this.currentIdentifier)), typescript_1.factory.createStringLiteral(importSpecifierPath), undefined); | ||
return Context_1.Context.factory.createImportDeclaration(undefined, Context_1.Context.factory.createImportClause(false, undefined, Context_1.Context.factory.createNamespaceImport(this.currentIdentifier)), Context_1.Context.factory.createStringLiteral(importSpecifierPath), undefined); | ||
} | ||
static internalPropertyAccessExpression(elementKind) { | ||
return typescript_1.factory.createPropertyAccessExpression(this.currentIdentifier, typescript_1.factory.createIdentifier(elementKind)); | ||
return Context_1.Context.factory.createPropertyAccessExpression(this.currentIdentifier, Context_1.Context.factory.createIdentifier(elementKind)); | ||
} | ||
} | ||
exports.InternalsAccessBuilder = InternalsAccessBuilder; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isBeanValueExpression = void 0; | ||
const typescript_1 = __importDefault(require("typescript")); | ||
const extractDecoratorMetadata_1 = require("../../decorator-processor/extractDecoratorMetadata"); | ||
@@ -13,3 +9,3 @@ const DecoratorKind_1 = require("../../decorator-processor/DecoratorKind"); | ||
const isBeanValueExpression = (node) => { | ||
if (!typescript_1.default.isPropertyDeclaration(node) && !typescript_1.default.isGetAccessorDeclaration(node)) { | ||
if (!Context_1.Context.ts.isPropertyDeclaration(node) && !Context_1.Context.ts.isGetAccessorDeclaration(node)) { | ||
return false; | ||
@@ -21,3 +17,3 @@ } | ||
} | ||
if (typescript_1.default.isGetAccessorDeclaration(node)) { | ||
if (Context_1.Context.ts.isGetAccessorDeclaration(node)) { | ||
return true; | ||
@@ -29,4 +25,4 @@ } | ||
} | ||
return !typescript_1.default.isArrowFunction(node.initializer); | ||
return !Context_1.Context.ts.isArrowFunction(node.initializer); | ||
}; | ||
exports.isBeanValueExpression = isBeanValueExpression; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.valueToASTExpression = void 0; | ||
const typescript_1 = __importStar(require("typescript")); | ||
const lodash_1 = require("lodash"); | ||
const createBoolean_1 = require("./createBoolean"); | ||
const Context_1 = require("../../../compilation-context/Context"); | ||
const valueToASTExpression = (value) => { | ||
if (typeof value === 'string') { | ||
return typescript_1.factory.createStringLiteral(value); | ||
return Context_1.Context.factory.createStringLiteral(value); | ||
} | ||
if (typeof value === 'number') { | ||
return typescript_1.factory.createNumericLiteral(value); | ||
return Context_1.Context.factory.createNumericLiteral(value); | ||
} | ||
@@ -41,8 +18,8 @@ if (typeof value === 'boolean') { | ||
if (value === null) { | ||
return typescript_1.factory.createNull(); | ||
return Context_1.Context.factory.createNull(); | ||
} | ||
if (value === undefined) { | ||
return typescript_1.factory.createIdentifier('undefined'); | ||
return Context_1.Context.factory.createIdentifier('undefined'); | ||
} | ||
if (typescript_1.default.isExpression(value)) { | ||
if (Context_1.Context.ts.isExpression(value)) { | ||
return value; | ||
@@ -54,9 +31,9 @@ } | ||
}); | ||
return typescript_1.factory.createArrayLiteralExpression(elements, true); | ||
return Context_1.Context.factory.createArrayLiteralExpression(elements, true); | ||
} | ||
if ((0, lodash_1.isObject)(value)) { | ||
const values = Object.entries(value).map(([key, value]) => { | ||
return typescript_1.factory.createPropertyAssignment(typescript_1.factory.createIdentifier(key), (0, exports.valueToASTExpression)(value)); | ||
return Context_1.Context.factory.createPropertyAssignment(Context_1.Context.factory.createIdentifier(key), (0, exports.valueToASTExpression)(value)); | ||
}); | ||
return typescript_1.factory.createObjectLiteralExpression(values, true); | ||
return Context_1.Context.factory.createObjectLiteralExpression(values, true); | ||
} | ||
@@ -63,0 +40,0 @@ throw new Error(`Unsupported value type: ${typeof value}, value: ${value}`); |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.valueToASTType = void 0; | ||
const typescript_1 = __importStar(require("typescript")); | ||
const lodash_1 = require("lodash"); | ||
const createBoolean_1 = require("./createBoolean"); | ||
const Context_1 = require("../../../compilation-context/Context"); | ||
const valueToASTType = (value) => { | ||
if (typeof value === 'string') { | ||
return typescript_1.factory.createLiteralTypeNode(typescript_1.factory.createStringLiteral(value)); | ||
return Context_1.Context.factory.createLiteralTypeNode(Context_1.Context.factory.createStringLiteral(value)); | ||
} | ||
if (typeof value === 'number') { | ||
return typescript_1.factory.createLiteralTypeNode(typescript_1.factory.createNumericLiteral(value)); | ||
return Context_1.Context.factory.createLiteralTypeNode(Context_1.Context.factory.createNumericLiteral(value)); | ||
} | ||
if (typeof value === 'boolean') { | ||
return typescript_1.factory.createLiteralTypeNode((0, createBoolean_1.createBoolean)(value)); | ||
return Context_1.Context.factory.createLiteralTypeNode((0, createBoolean_1.createBoolean)(value)); | ||
} | ||
if (value === null) { | ||
return typescript_1.factory.createLiteralTypeNode(typescript_1.factory.createNull()); | ||
return Context_1.Context.factory.createLiteralTypeNode(Context_1.Context.factory.createNull()); | ||
} | ||
if (value === undefined) { | ||
return typescript_1.factory.createKeywordTypeNode(typescript_1.default.SyntaxKind.UndefinedKeyword); | ||
return Context_1.Context.factory.createKeywordTypeNode(Context_1.Context.ts.SyntaxKind.UndefinedKeyword); | ||
} | ||
if (typescript_1.default.isTypeNode(value)) { | ||
if (Context_1.Context.ts.isTypeNode(value)) { | ||
return value; | ||
@@ -53,9 +30,9 @@ } | ||
}); | ||
return typescript_1.factory.createTupleTypeNode(elements); | ||
return Context_1.Context.factory.createTupleTypeNode(elements); | ||
} | ||
if ((0, lodash_1.isObject)(value)) { | ||
const values = Object.entries(value).map(([key, value]) => { | ||
return typescript_1.factory.createPropertySignature(undefined, typescript_1.factory.createIdentifier(key), undefined, (0, exports.valueToASTType)(value)); | ||
return Context_1.Context.factory.createPropertySignature(undefined, Context_1.Context.factory.createIdentifier(key), undefined, (0, exports.valueToASTType)(value)); | ||
}); | ||
return typescript_1.factory.createTypeLiteralNode(values); | ||
return Context_1.Context.factory.createTypeLiteralNode(values); | ||
} | ||
@@ -62,0 +39,0 @@ throw new Error(`Unsupported value type: ${typeof value}, value: ${value}`); |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TypeComparator = void 0; | ||
const typescript_1 = __importStar(require("typescript")); | ||
const lodash_1 = require("lodash"); | ||
@@ -51,3 +27,3 @@ const isNotEmpty_1 = require("../utils/isNotEmpty"); | ||
static isReferenceType(type) { | ||
return this.checkObjectFlag(type, typescript_1.ObjectFlags.Reference); | ||
return this.checkObjectFlag(type, Context_1.Context.ts.ObjectFlags.Reference); | ||
} | ||
@@ -75,12 +51,12 @@ static compareType(source, target) { | ||
} | ||
if (this.checkFlag(source, typescript_1.TypeFlags.Any) || this.checkFlag(target, typescript_1.TypeFlags.Any)) { | ||
if (this.checkFlag(source, Context_1.Context.ts.TypeFlags.Any) || this.checkFlag(target, Context_1.Context.ts.TypeFlags.Any)) { | ||
return true; | ||
} | ||
if (this.checkFlag(source, typescript_1.TypeFlags.Unknown) || this.checkFlag(target, typescript_1.TypeFlags.Unknown)) { | ||
if (this.checkFlag(source, Context_1.Context.ts.TypeFlags.Unknown) || this.checkFlag(target, Context_1.Context.ts.TypeFlags.Unknown)) { | ||
return true; | ||
} | ||
if (this.checkFlag(source, typescript_1.TypeFlags.Union)) { | ||
if (this.checkFlag(source, Context_1.Context.ts.TypeFlags.Union)) { | ||
return source.types.every(it => this.compareType(it, target)); | ||
} | ||
if (this.checkFlag(source, typescript_1.TypeFlags.Intersection) && this.checkFlag(target, typescript_1.TypeFlags.Intersection)) { | ||
if (this.checkFlag(source, Context_1.Context.ts.TypeFlags.Intersection) && this.checkFlag(target, Context_1.Context.ts.TypeFlags.Intersection)) { | ||
return target.types.every(targetType => { | ||
@@ -90,15 +66,15 @@ return source.types.some(sourceType => this.compareType(sourceType, targetType)); | ||
} | ||
if (this.checkFlag(target, typescript_1.TypeFlags.Union)) { | ||
if (this.checkFlag(target, Context_1.Context.ts.TypeFlags.Union)) { | ||
return target.types.some(it => this.compareType(source, it)); | ||
} | ||
if (this.checkFlag(target, typescript_1.TypeFlags.Intersection)) { | ||
if (this.checkFlag(target, Context_1.Context.ts.TypeFlags.Intersection)) { | ||
return target.types.every(it => this.compareType(source, it)); | ||
} | ||
if (this.checkFlag(source, typescript_1.TypeFlags.Intersection)) { | ||
if (this.checkFlag(source, Context_1.Context.ts.TypeFlags.Intersection)) { | ||
return source.types.some(it => this.compareType(it, target)); | ||
} | ||
if (this.checkFlag(source, typescript_1.TypeFlags.Primitive) !== this.checkFlag(target, typescript_1.TypeFlags.Primitive)) { | ||
if (this.checkFlag(source, Context_1.Context.ts.TypeFlags.Primitive) !== this.checkFlag(target, Context_1.Context.ts.TypeFlags.Primitive)) { | ||
return false; | ||
} | ||
if (this.checkObjectFlag(source, typescript_1.ObjectFlags.Anonymous) || this.checkObjectFlag(target, typescript_1.ObjectFlags.Anonymous)) { | ||
if (this.checkObjectFlag(source, Context_1.Context.ts.ObjectFlags.Anonymous) || this.checkObjectFlag(target, Context_1.Context.ts.ObjectFlags.Anonymous)) { | ||
return this.compareAnonymousAliasSymbols(source, target); | ||
@@ -109,3 +85,3 @@ } | ||
} | ||
if (this.checkFlag(source, typescript_1.TypeFlags.Object) && this.checkFlag(target, typescript_1.TypeFlags.Object)) { | ||
if (this.checkFlag(source, Context_1.Context.ts.TypeFlags.Object) && this.checkFlag(target, Context_1.Context.ts.TypeFlags.Object)) { | ||
const expandedSourceTypes = this.getExpandedObjectType(source); | ||
@@ -125,3 +101,3 @@ const expandedTargetTypes = this.getExpandedObjectType(target); | ||
const baseTypeArguments = Context_1.Context.typeChecker.getTypeArguments(baseType).filter(it => { | ||
return !typescript_1.default.isThisTypeParameter(it); | ||
return !Context_1.Context.ts.isThisTypeParameter(it); | ||
}); | ||
@@ -142,3 +118,3 @@ const baseTypeSymbol = baseType.getSymbol(); | ||
var _a, _b, _c; | ||
if (typescript_1.default.isClassDeclaration(declaration) || typescript_1.default.isInterfaceDeclaration(declaration)) { | ||
if (Context_1.Context.ts.isClassDeclaration(declaration) || Context_1.Context.ts.isInterfaceDeclaration(declaration)) { | ||
const typeArgumentsMap = new Map(); | ||
@@ -156,3 +132,3 @@ (_a = declaration.typeParameters) === null || _a === void 0 ? void 0 : _a.forEach((it, i) => { | ||
const type = Context_1.Context.typeChecker.getTypeAtLocation(it); | ||
if (typescript_1.default.isThisTypeParameter(type)) { | ||
if (Context_1.Context.ts.isThisTypeParameter(type)) { | ||
return; | ||
@@ -159,0 +135,0 @@ } |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DiagnosticsBuilder = void 0; | ||
const typescript_1 = __importStar(require("typescript")); | ||
const CircularDependenciesError_1 = require("../compilation-context/messages/errors/CircularDependenciesError"); | ||
@@ -36,5 +12,6 @@ const CanNotRegisterBeanError_1 = require("../compilation-context/messages/errors/CanNotRegisterBeanError"); | ||
const Context_1 = require("../compilation-context/Context"); | ||
const lodash_1 = require("lodash"); | ||
class DiagnosticsBuilder { | ||
static diagnosticsToString(diagnostics) { | ||
return typescript_1.default.formatDiagnosticsWithColorAndContext(diagnostics, this.formatDiagnosticsHost); | ||
return Context_1.Context.ts.formatDiagnosticsWithColorAndContext(diagnostics, this.formatDiagnosticsHost); | ||
} | ||
@@ -45,3 +22,3 @@ static getDiagnostics(fileName) { | ||
: Context_1.Context.getAllMessages(); | ||
return (0, typescript_1.compact)(messages | ||
return (0, lodash_1.compact)(messages | ||
.map(it => this.compilationMessageToDiagnostic(it))); | ||
@@ -180,7 +157,7 @@ } | ||
case MessageType_1.MessageType.INFO: | ||
return typescript_1.default.DiagnosticCategory.Suggestion; | ||
return Context_1.Context.ts.DiagnosticCategory.Suggestion; | ||
case MessageType_1.MessageType.WARNING: | ||
return typescript_1.default.DiagnosticCategory.Warning; | ||
return Context_1.Context.ts.DiagnosticCategory.Warning; | ||
case MessageType_1.MessageType.ERROR: | ||
return typescript_1.default.DiagnosticCategory.Error; | ||
return Context_1.Context.ts.DiagnosticCategory.Error; | ||
} | ||
@@ -196,3 +173,3 @@ } | ||
file: this.getSourceFile(relatedConfigurationMetadata.fileName), | ||
category: typescript_1.default.DiagnosticCategory.Message, | ||
category: Context_1.Context.ts.DiagnosticCategory.Message, | ||
code: 0, | ||
@@ -199,0 +176,0 @@ }; |
{ | ||
"name": "@clawject/di", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "dependency-injection", |
427048
8909