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.2.5 to 0.2.6

README.md

10

lib/main.d.ts

@@ -1,12 +0,2 @@

interface Options {
outputFormat: 'json' | 'line' | 'vis' | 'graphSON';
id: 'number' | 'uuid';
projectRoot?: string;
noContents: boolean;
}
export declare namespace Options {
const defaults: Options;
}
export declare function main(this: void, args: string[]): void;
export declare function run(): void;
export {};

58

lib/main.js

@@ -16,7 +16,18 @@ "use strict";

Options.defaults = {
help: false,
version: false,
outputFormat: 'line',
id: 'number',
projectRoot: undefined,
noContents: false
};
})(Options = exports.Options || (exports.Options = {}));
Options.descriptions = [
{ id: 'version', type: 'boolean', alias: 'v', default: false, description: 'output the version number' },
{ id: 'help', type: 'boolean', alias: 'h', default: false, description: 'output usage information' },
{ id: 'outputFormat', type: 'string', default: 'line', values: ['line', 'json'], description: 'Specifies the output format. Allowed values are: \'line\' and \'json\'.' },
{ id: 'id', type: 'string', default: 'number', values: ['number', 'uuid'], description: 'Specifies the id format. Allowed values are: \'number\' and \'uuid\'.' },
{ id: 'projectRoot', type: 'string', default: undefined, description: 'Specifies the project root. Defaults to the location of the [tj]sconfig.json file.' },
{ id: 'noContents', type: 'boolean', default: false, description: 'File contents will not be embedded into the dump.' },
];
})(Options || (Options = {}));
function loadConfigFile(file) {

@@ -162,8 +173,41 @@ let absolute = path.resolve(file);

function main(args) {
const options = Object.assign(Options.defaults, minimist(process.argv.slice(2), {
string: [
'outputFormat', 'id', 'projectRoot'
],
boolean: ['noContents']
}));
let minOpts = {
string: [],
boolean: [],
default: Object.create(null),
alias: Object.create(null)
};
let longestId = 0;
for (let description of Options.descriptions) {
longestId = Math.max(longestId, description.id.length);
minOpts[description.type] = description.id;
minOpts.default[description.id] = description.default;
if (description.alias !== undefined) {
minOpts.alias[description.id] = [description.alias];
}
}
const options = Object.assign(Options.defaults, minimist(process.argv.slice(2), minOpts));
if (options.version) {
console.log(require('../package.json').version);
return;
}
let buffer = [];
if (options.help) {
buffer.push(`Languag Server Index Format tool for TypeScript`);
buffer.push(`Version: ${require('../package.json').version}`);
buffer.push('');
buffer.push(`Usage: lsif-tsc [options][tsc options]`);
buffer.push('');
buffer.push(`Options`);
for (let description of Options.descriptions) {
if (description.alias !== undefined) {
buffer.push(` -${description.alias} --${description.id}${' '.repeat(longestId - description.id.length)} ${description.description}`);
}
else {
buffer.push(` --${description.id} ${' '.repeat(longestId - description.id.length)} ${description.description}`);
}
}
console.log(buffer.join('\n'));
return;
}
const config = ts.parseCommandLine(args);

@@ -170,0 +214,0 @@ const idGenerator = createIdGenerator(options);

{
"name": "lsif-tsc",
"description": "Tool to create an LSIF dump for TypeScript projects.",
"version": "0.2.5",
"version": "0.2.6",
"author": "Microsoft Corporation",

@@ -6,0 +6,0 @@ "license": "MIT",

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