Socket
Socket
Sign inDemoInstall

tspoon

Package Overview
Dependencies
Maintainers
9
Versions
410
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tspoon - npm Package Compare versions

Comparing version 1.0.78 to 1.0.79

14

dist/src/chainable-hosts.js

@@ -71,7 +71,9 @@ "use strict";

__extends(SemanticHost, _super);
function SemanticHost(files, compilerOptions) {
function SemanticHost(files, compilerOptions, libDir) {
if (compilerOptions === void 0) { compilerOptions = configuration_1.defaultCompilerOptions; }
if (libDir === void 0) { libDir = 'node_modules'; }
_super.call(this);
this.files = files;
this.compilerOptions = compilerOptions;
this.libDir = libDir;
}

@@ -104,14 +106,6 @@ SemanticHost.prototype.getProjectVersion = function () {

var _this = this;
var containingDir = getDirectoryPath(containingFile);
return moduleNames.map(function (moduleName) {
var resolvedBase = normalizePath(combinePaths(containingDir, moduleName));
return {
resolvedFileName: _this.tryResolveFileName(resolvedBase + '.tsx') || _this.tryResolveFileName(resolvedBase + '.ts'),
isExternalLibraryImport: false
};
return ts.nodeModuleNameResolver(moduleName, containingFile, _this.compilerOptions, _this).resolvedModule;
});
};
SemanticHost.prototype.tryResolveFileName = function (candidate) {
return this.source.fileExists(candidate) ? candidate : null;
};
SemanticHost.prototype.directoryExists = function (directoryName) {

@@ -118,0 +112,0 @@ return null;

{
"private": false,
"name": "tspoon",
"version": "1.0.78",
"version": "1.0.79",
"description": "see README.md",

@@ -6,0 +6,0 @@ "main": "./dist/src/index.js",

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

constructor(private files:string[],
private compilerOptions:ts.CompilerOptions = defaultCompilerOptions) {
private compilerOptions:ts.CompilerOptions = defaultCompilerOptions,
private libDir: string = 'node_modules'
) {
super();

@@ -108,16 +110,7 @@ }

resolveModuleNames(moduleNames:string[], containingFile:string):ts.ResolvedModule[] {
const containingDir:string = getDirectoryPath(containingFile);
return moduleNames.map((moduleName:string) => {
const resolvedBase:string = normalizePath(combinePaths(containingDir, moduleName));
return {
resolvedFileName: this.tryResolveFileName(resolvedBase + '.tsx') || this.tryResolveFileName(resolvedBase + '.ts'),
isExternalLibraryImport: false
}
return ts.nodeModuleNameResolver(moduleName, containingFile, this.compilerOptions, this).resolvedModule;
});
}
private tryResolveFileName(candidate:string):string {
return this.source.fileExists(candidate) ? candidate : null;
}
directoryExists(directoryName:string):boolean {

@@ -124,0 +117,0 @@ return null;

@@ -170,3 +170,5 @@ import {expect} from 'chai';

`),
new MockModule('node_modules/lib/index.ts', ''),
new MockModule('index.ts', `
import * as lib from 'lib';
import {default as SomeClass} from './a';

@@ -173,0 +175,0 @@ const a: SomeClass = null;

Sorry, the diff of this file is not supported yet

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