@travetto/transformer
Advanced tools
Comparing version 3.1.0-rc.4 to 3.1.0-rc.5
{ | ||
"name": "@travetto/transformer", | ||
"version": "3.1.0-rc.4", | ||
"version": "3.1.0-rc.5", | ||
"description": "Functionality for AST transformations, with transformer registration, and general utils", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -56,9 +56,10 @@ /* eslint-disable no-bitwise */ | ||
} else if (objectFlags & ts.ObjectFlags.Anonymous) { | ||
const source = DeclarationUtil.getPrimaryDeclarationNode(type).getSourceFile(); | ||
const sourceFile = source.fileName; | ||
if (sourceFile?.endsWith('.d.ts') && !resolver.isKnownFile(sourceFile)) { | ||
return { category: 'foreign', type }; | ||
} else { | ||
return { category: 'shape', type }; | ||
} | ||
try { | ||
const source = DeclarationUtil.getPrimaryDeclarationNode(type).getSourceFile(); | ||
const sourceFile = source.fileName; | ||
if (sourceFile?.endsWith('.d.ts') && !resolver.isKnownFile(sourceFile)) { | ||
return { category: 'foreign', type }; | ||
} | ||
} catch { } | ||
return { category: 'shape', type }; | ||
} else if (objectFlags & (ts.ObjectFlags.Reference | ts.ObjectFlags.Class | ts.ObjectFlags.Interface)) { | ||
@@ -65,0 +66,0 @@ let resolvedType = type; |
@@ -5,3 +5,3 @@ import ts from 'typescript'; | ||
import { ManagedType, AnyType } from './resolver/types'; | ||
import { ManagedType, AnyType, ForeignType } from './resolver/types'; | ||
import { State, DecoratorMeta, Transformer, ModuleNameⲐ } from './types/visitor'; | ||
@@ -360,2 +360,11 @@ import { SimpleResolver } from './resolver/service'; | ||
} | ||
/** | ||
* Get foreign target | ||
*/ | ||
getForeignTarget(state: TransformerState, ret: ForeignType): ts.Expression { | ||
return state.fromLiteral({ | ||
Ⲑid: `${ret.source.split('node_modules')[1]}+${ret.name}` | ||
}); | ||
} | ||
} |
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
90136
2270