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

@travetto/transformer

Package Overview
Dependencies
Maintainers
1
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@travetto/transformer - npm Package Compare versions

Comparing version 2.0.0-alpha.5 to 2.0.0-alpha.6

4

package.json
{
"name": "@travetto/transformer",
"displayName": "Transformation",
"version": "2.0.0-alpha.5",
"version": "2.0.0-alpha.6",
"description": "Functionality for AST transformations, with transformer registration, and general utils",

@@ -29,3 +29,3 @@ "keywords": [

"dependencies": {
"@travetto/base": "^2.0.0-alpha.5"
"@travetto/base": "^2.0.0-alpha.6"
},

@@ -32,0 +32,0 @@ "publishConfig": {

@@ -43,2 +43,7 @@ import * as ts from 'typescript';

// Allow for node classes to be imported directly
if (/@types\/node/.test(file)) {
file = require.resolve(file.replace(/.*@types\/node\//, '').replace(/[.]d([.]ts)?$/, ''));
}
// Handle relative imports

@@ -56,3 +61,3 @@ if (file.startsWith('.') && base &&

if (!file.endsWith('.d.ts') && !this.#newImports.has(file)) {
if (!/[.]d([.]ts)?$/.test(file) && !this.#newImports.has(file)) {
const id = this.getId(file);

@@ -59,0 +64,0 @@

@@ -64,11 +64,10 @@ /* eslint-disable no-bitwise */

if (!resolvedType.isClass()) { // Real type
const source = DeclarationUtil.getPrimaryDeclarationNode(resolvedType).getSourceFile();
if (source && source.fileName.includes('typescript/lib')) { // Global Type
return { category: 'literal', type };
} else {
return { category: 'shape', type: resolvedType };
}
const source = DeclarationUtil.getPrimaryDeclarationNode(resolvedType).getSourceFile();
if (source?.fileName.includes('@types/node/globals') || source?.fileName.includes('typescript/lib')) {
return { category: 'literal', type };
} else if (!resolvedType.isClass()) { // Not a real type
return { category: 'shape', type: resolvedType };
} else {
return { category: 'external', type: resolvedType };
}
return { category: 'external', type: resolvedType };
} else if (flags & (

@@ -75,0 +74,0 @@ ts.TypeFlags.Boolean | ts.TypeFlags.BooleanLiteral |

@@ -9,3 +9,2 @@ import * as ts from 'typescript';

import { State, DecoratorMeta, Transformer, TransformerId } from './types/visitor';
import { TypeResolver } from './resolver/service';

@@ -12,0 +11,0 @@ import { ImportManager } from './importer';

@@ -61,3 +61,3 @@ import * as ts from 'typescript';

static getSymbol(type: ts.Type | ts.Symbol) {
if ('valueDeclaration' in type) {
if ('valueDeclaration' in type || 'escapedName' in type) {
return type;

@@ -64,0 +64,0 @@ } else {

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