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

lsif-tsc

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lsif-tsc - npm Package Compare versions

Comparing version 0.5.3 to 0.5.4

1

lib/typings.d.ts

@@ -10,5 +10,4 @@ export declare class TypingsInstaller {

private filterTypingsToInstall;
private loadNpm;
private validateTypingsOnNpm;
private doInstallTypingsFromNpm;
}

@@ -20,2 +20,3 @@ "use strict";

const _fs = require("fs");
const cp = require("child_process");
var fs;

@@ -28,2 +29,7 @@ (function (fs) {

})(fs || (fs = {}));
var pcp;
(function (pcp) {
pcp.exec = util_1.promisify(cp.exec);
})(pcp || (pcp = {}));
const latest_version_1 = require("latest-version");
function stripComments(content) {

@@ -96,3 +102,2 @@ const regexp = /("(?:[^\\"]*(?:\\.)?)*")|('(?:[^\\']*(?:\\.)?)*')|(\/\*(?:\r?\n|.)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))/g;

}
yield this.loadNpm(packageFile);
yield this.doInstallTypingsFromNpm(yield this.validateTypingsOnNpm(typings));

@@ -126,3 +131,2 @@ this.handledTsConfig.add(key);

}
yield this.loadNpm(packageFile);
yield this.doInstallTypingsFromNpm(yield this.validateTypingsOnNpm(typings));

@@ -193,18 +197,2 @@ this.handledPackages.add(packageFile);

}
loadNpm(packageFile) {
return __awaiter(this, void 0, void 0, function* () {
const prefix = path.dirname(packageFile);
let npm = yield Promise.resolve().then(() => require('npm'));
yield new Promise((resolve, reject) => {
npm.load({ json: true, save: false, 'save-dev': false, prefix: prefix, spin: false, loglevel: 'silent', 'progress': false, 'audit': false }, (error, config) => {
if (error) {
reject(error);
}
else {
resolve(config);
}
});
});
});
}
validateTypingsOnNpm(typings) {

@@ -216,13 +204,5 @@ return __awaiter(this, void 0, void 0, function* () {

const promises = [];
let npm = yield Promise.resolve().then(() => require('npm'));
for (let typing of typings) {
try {
promises.push(new Promise((resolve, _reject) => {
npm.commands.view([typing], true, (error, _result) => {
if (error) {
resolve(undefined);
}
resolve(typing);
});
}));
promises.push(latest_version_1.default(typing).then(() => typing, (_error) => undefined));
}

@@ -248,17 +228,5 @@ catch (error) {

}
let npm = yield Promise.resolve().then(() => require('npm'));
return new Promise((resolve, reject) => {
// NPM can't be made really silent. So we patch console.log while we are actually
// updating. Will not affect outputting LSIF to stdout since we wait until the installer
// is finished.
const save = console.log;
console.log = () => { };
npm.commands.install(typings, (error, result) => {
console.log = save;
if (error) {
reject(error);
}
resolve(result);
});
});
// Need to think about command length. Might be a limit.
const command = `npm install --no-save ${typings.join(' ')}`;
yield pcp.exec(command);
});

@@ -265,0 +233,0 @@ }

4

package.json
{
"name": "lsif-tsc",
"description": "Tool to create an LSIF dump for TypeScript projects.",
"version": "0.5.3",
"version": "0.5.4",
"author": "Microsoft Corporation",

@@ -22,4 +22,4 @@ "license": "MIT",

"yargs": "16.2.0",
"npm": "^7.5.2",
"uuid": "^8.3.2",
"latest-version": "5.1.0",
"vscode-uri": "^3.0.2",

@@ -26,0 +26,0 @@ "typescript": "https://github.com/dbaeumer/TypeScript/releases/download/4.1.3-lsif.1/typescript-4.1.3-lsif.1.tgz"

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