Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@esportsplus/typescript

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@esportsplus/typescript - npm Package Compare versions

Comparing version
0.27.4
to
0.27.5
+6
-1
build/compiler/plugins/vite.js

@@ -5,2 +5,3 @@ import { ts } from '../../index.js';

const FILE_REGEX = /\.[tj]sx?$/;
const DIRECTORY_SEPARATOR_REGEX = /\\/g;
let contexts = new Map();

@@ -20,3 +21,7 @@ export default ({ name, onWatchChange, plugins }) => {

try {
let result = coordinator.transform(plugins, code, ts.createSourceFile(id, code, ts.ScriptTarget.Latest, true), program.get(root || ''), contexts.get(root || '') ?? contexts.set(root || '', new Map()).get(root || ''));
let prog = program.get(root || ''), sourceFile = prog.getSourceFile(id.replace(DIRECTORY_SEPARATOR_REGEX, '/')) || prog.getSourceFile(id);
if (!sourceFile || sourceFile.getText() !== code) {
sourceFile = ts.createSourceFile(id, code, ts.ScriptTarget.Latest, true);
}
let result = coordinator.transform(plugins, code, sourceFile, prog, contexts.get(root || '') ?? contexts.set(root || '', new Map()).get(root || ''));
if (!result.changed) {

@@ -23,0 +28,0 @@ return null;

+1
-1

@@ -40,3 +40,3 @@ {

"types": "build/index.d.ts",
"version": "0.27.4",
"version": "0.27.5",
"scripts": {

@@ -43,0 +43,0 @@ "build": "tsc && tsc-alias",

@@ -25,3 +25,5 @@ import type { ResolvedConfig } from 'vite';

const DIRECTORY_SEPARATOR_REGEX = /\\/g;
let contexts = new Map<string, SharedContext>();

@@ -44,7 +46,14 @@

try {
let prog = program.get(root || ''),
sourceFile = prog.getSourceFile(id.replace(DIRECTORY_SEPARATOR_REGEX, '/')) || prog.getSourceFile(id);
if (!sourceFile || sourceFile.getText() !== code) {
sourceFile = ts.createSourceFile(id, code, ts.ScriptTarget.Latest, true);
}
let result = coordinator.transform(
plugins,
code,
ts.createSourceFile(id, code, ts.ScriptTarget.Latest, true),
program.get(root || ''),
sourceFile,
prog,
contexts.get(root || '') ?? contexts.set(root || '', new Map()).get(root || '')!

@@ -51,0 +60,0 @@ );