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
147
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 3.1.0 to 3.1.2

2

package.json
{
"name": "@travetto/transformer",
"version": "3.1.0",
"version": "3.1.2",
"description": "Functionality for AST transformations, with transformer registration, and general utils",

@@ -5,0 +5,0 @@ "keywords": [

@@ -298,13 +298,17 @@ import ts from 'typescript';

generateUniqueIdentifier(node: ts.Node, type: AnyType): string {
let unique: string;
let unique: string | undefined;
try {
// Tie to source location if possible
const tgt = DeclarationUtil.getPrimaryDeclarationNode(type.original!);
unique = `${ts.getLineAndCharacterOfPosition(tgt.getSourceFile(), tgt.getStart()).line}_${tgt.getEnd() - tgt.getStart()}`;
if (tgt.getSourceFile().fileName !== this.source.fileName) { // if in same file
unique = `${SystemUtil.naiveHash(tgt.getSourceFile().fileName)}_${unique}`;
const fileName = tgt.getSourceFile().fileName;
if (fileName === this.source.fileName) { // if in same file suffix with location
unique = `${ts.getLineAndCharacterOfPosition(tgt.getSourceFile(), tgt.getStart()).line}_${tgt.getEnd() - tgt.getStart()}`;
} else {
// Otherwise treat it as external and add nothing to it
}
} catch {
// Determine type unique ident
unique = SystemUtil.uuid(type.name ? 5 : 10);
const imp = this.#resolver.getFileImportName(this.source.fileName);
unique = `${SystemUtil.naiveHash(`${imp}${type.name ?? 'unknown'}`)}`;
}

@@ -316,3 +320,4 @@ // Otherwise read name with uuid

}
return `${name}_${unique}`;
name ||= 'Shape';
return unique ? `${name}_${unique}` : name;
}

@@ -319,0 +324,0 @@

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