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

tplant

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tplant - npm Package Compare versions

Comparing version 2.3.2 to 2.3.3

dist/Components/Class.d.ts

44

dist/index.js

@@ -10,10 +10,11 @@ #!/usr/bin/env node

var glob_1 = __importDefault(require("glob"));
var http_1 = __importDefault(require("http"));
var os_1 = __importDefault(require("os"));
var path_1 = __importDefault(require("path"));
var plantuml_encoder_1 = require("plantuml-encoder");
var typescript_1 = __importDefault(require("typescript"));
var convertToPlant_1 = require("./convertToPlant");
var generateDocumentation_1 = require("./generateDocumentation");
var tplant_1 = require("./tplant");
var AVAILABLE_PLANTUML_EXTENSIONS = ['svg', 'png', 'txt'];
commander_1.default
.version('2.1.3')
.usage('[options]')
.version('2.3.3')
.option('-i, --input <path>', 'Define the path of the Typescript file')

@@ -33,7 +34,6 @@ .option('-o, --output <path>', 'Define the path of the output file. If not defined, it\'ll output on the STDOUT')

if (err !== null) {
console.error(err);
return;
throw err;
}
var tsConfigFile = findTsConfigFile(commander_1.default.input, commander_1.default.tsconfig);
var output = convertToPlant_1.convertToPlant(generateDocumentation_1.generateDocumentation(matches, getCompilerOptions(tsConfigFile)), {
var plantUMLDocument = tplant_1.tplant.convertToPlant(tplant_1.tplant.generateDocumentation(matches, getCompilerOptions(tsConfigFile)), {
compositions: commander_1.default.compositions,

@@ -43,12 +43,12 @@ onlyInterfaces: commander_1.default.onlyInterfaces

if (commander_1.default.output === undefined) {
console.log(output);
console.log(plantUMLDocument);
return;
}
fs_1.default.writeFile(commander_1.default.output, output, function (errNoException) {
if (errNoException !== null) {
console.error(errNoException);
return;
}
console.log('The file was saved!');
});
var extension = path_1.default.extname(commander_1.default.output)
.replace(/^\./gm, '');
if (AVAILABLE_PLANTUML_EXTENSIONS.includes(extension)) {
requestImageFile(commander_1.default.output, plantUMLDocument, extension);
return;
}
fs_1.default.writeFileSync(commander_1.default.output, plantUMLDocument, 'utf-8');
});

@@ -76,2 +76,3 @@ function findTsConfigFile(inputPath, tsConfigPath) {

}
return;
}

@@ -100,1 +101,14 @@ function getCompilerOptions(tsConfigFilePath) {

}
function requestImageFile(output, input, extension) {
http_1.default.get({
host: 'www.plantuml.com',
path: "/plantuml/" + extension + "/" + plantuml_encoder_1.encode(input)
}, function (res) {
var fileStream = fs_1.default.createWriteStream(output);
res.setEncoding('utf-8');
res.pipe(fileStream);
res.on('error', function (err) {
throw err;
});
});
}
{
"name": "tplant",
"version": "2.3.2",
"version": "2.3.3",
"description": "Typescript to PlantUML",

@@ -5,0 +5,0 @@ "keywords": [

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