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.1 to 2.3.2

dist/components/Class.d.ts

44

dist/index.js

@@ -10,11 +10,10 @@ #!/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 tplant_1 = require("./tplant");
var AVAILABLE_PLANTUML_EXTENSIONS = ['svg', 'png', 'txt'];
var convertToPlant_1 = require("./convertToPlant");
var generateDocumentation_1 = require("./generateDocumentation");
commander_1.default
.version('2.3.1')
.version('2.1.3')
.usage('[options]')
.option('-i, --input <path>', 'Define the path of the Typescript file')

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

if (err !== null) {
throw err;
console.error(err);
return;
}
var tsConfigFile = findTsConfigFile(commander_1.default.input, commander_1.default.tsconfig);
var plantUMLDocument = tplant_1.tplant.convertToPlant(tplant_1.tplant.generateDocumentation(matches, getCompilerOptions(tsConfigFile)), {
var output = convertToPlant_1.convertToPlant(generateDocumentation_1.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(plantUMLDocument);
console.log(output);
return;
}
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, 'binary');
fs_1.default.writeFile(commander_1.default.output, output, function (errNoException) {
if (errNoException !== null) {
console.error(errNoException);
return;
}
console.log('The file was saved!');
});
});

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

}
return;
}

@@ -101,14 +100,1 @@ 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('binary');
res.pipe(fileStream);
res.on('error', function (err) {
throw err;
});
});
}
{
"name": "tplant",
"version": "2.3.1",
"version": "2.3.2",
"description": "Typescript to PlantUML",

@@ -56,2 +56,3 @@ "keywords": [

"ts-jest": "^24.0.2",
"ts-node": "^8.5.4",
"tslint": "^5.16.0",

@@ -58,0 +59,0 @@ "tslint-microsoft-contrib": "^6.1.1"

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