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

@volar/typescript

Package Overview
Dependencies
Maintainers
1
Versions
222
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@volar/typescript - npm Package Compare versions

Comparing version 2.0.4 to 2.1.0

24

lib/node/decorateLanguageServiceHost.js

@@ -36,8 +36,8 @@ "use strict";

languageServiceHost.resolveModuleNameLiterals = (moduleLiterals, containingFile, redirectedReference, options, ...rest) => {
return [
...resolveModuleNameLiterals(moduleLiterals.filter(name => !exts.some(ext => name.text.endsWith(ext))), containingFile, redirectedReference, options, ...rest),
...moduleLiterals
.filter(name => exts.some(ext => name.text.endsWith(ext)))
.map(name => resolveModuleName(name.text, containingFile, options, undefined, redirectedReference)),
];
if (moduleLiterals.every(name => !exts.some(ext => name.text.endsWith(ext)))) {
return resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, ...rest);
}
return moduleLiterals.map(moduleLiteral => {
return resolveModuleName(moduleLiteral.text, containingFile, options, undefined, redirectedReference);
});
};

@@ -47,8 +47,8 @@ }

languageServiceHost.resolveModuleNames = (moduleNames, containingFile, reusedNames, redirectedReference, options, containingSourceFile) => {
return [
...resolveModuleNames(moduleNames.filter(name => !exts.some(ext => name.endsWith(ext))), containingFile, reusedNames, redirectedReference, options, containingSourceFile),
...moduleNames
.filter(name => exts.some(ext => name.endsWith(ext)))
.map(moduleName => resolveModuleName(moduleName, containingFile, options, undefined, redirectedReference).resolvedModule),
];
if (moduleNames.every(name => !exts.some(ext => name.endsWith(ext)))) {
return resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference, options, containingSourceFile);
}
return moduleNames.map(moduleName => {
return resolveModuleName(moduleName, containingFile, options, undefined, redirectedReference).resolvedModule;
});
};

@@ -55,0 +55,0 @@ }

@@ -1,6 +0,6 @@

import type { ServiceEnvironment, Disposable, TypeScriptProjectHost } from '@volar/language-service';
import type { ServiceEnvironment, Disposable } from '@volar/language-service';
import type * as ts from 'typescript';
export declare function createSys(ts: typeof import('typescript'), env: ServiceEnvironment, projectHost: TypeScriptProjectHost): ts.System & {
export declare function createSys(ts: typeof import('typescript'), env: ServiceEnvironment, currentDirectory: string): ts.System & {
version: number;
sync(): Promise<number>;
} & Disposable;

@@ -7,5 +7,4 @@ "use strict";

let currentCwd = '';
function createSys(ts, env, projectHost) {
function createSys(ts, env, currentDirectory) {
let version = 0;
const rootPath = projectHost.getCurrentDirectory();
const sys = ts.sys;

@@ -60,4 +59,4 @@ const root = {

exit: sys?.exit ?? (() => { }),
getExecutingFilePath: sys?.getExecutingFilePath ?? (() => rootPath + '/__fake__.js'),
getCurrentDirectory: () => rootPath,
getExecutingFilePath: sys?.getExecutingFilePath ?? (() => currentDirectory + '/__fake__.js'),
getCurrentDirectory: () => currentDirectory,
getModifiedTime,

@@ -82,11 +81,11 @@ readFile,

if (sys) {
if (currentCwd !== rootPath) {
currentCwd = rootPath;
if (currentCwd !== currentDirectory) {
currentCwd = currentDirectory;
// https://github.com/vuejs/language-tools/issues/2039
// https://github.com/vuejs/language-tools/issues/2234
if (sys.directoryExists(rootPath)) {
if (sys.directoryExists(currentDirectory)) {
// https://github.com/vuejs/language-tools/issues/2480
try {
// @ts-ignore
process.chdir(rootPath);
process.chdir(currentDirectory);
}

@@ -190,3 +189,3 @@ catch { }

dirName = resolvePath(dirName);
const matches = (0, utilities_1.matchFiles)(dirName, extensions, excludes, includes, sys?.useCaseSensitiveFileNames ?? false, rootPath, depth, dirPath => {
const matches = (0, utilities_1.matchFiles)(dirName, extensions, excludes, includes, sys?.useCaseSensitiveFileNames ?? false, currentDirectory, depth, dirPath => {
dirPath = resolvePath(dirPath);

@@ -193,0 +192,0 @@ readDirectoryWorker(dirPath);

{
"name": "@volar/typescript",
"version": "2.0.4",
"version": "2.1.0",
"license": "MIT",

@@ -15,3 +15,3 @@ "files": [

"dependencies": {
"@volar/language-core": "2.0.4",
"@volar/language-core": "2.1.0",
"path-browserify": "^1.0.1"

@@ -22,5 +22,5 @@ },

"@types/path-browserify": "latest",
"@volar/language-service": "2.0.4"
"@volar/language-service": "2.1.0"
},
"gitHead": "b3dc544424c95f8b72e832fbaa0f85a34442389b"
"gitHead": "09e1792f0adafb02caf89a5a45a6fcaaf3177808"
}
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