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

repo2pdf

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

repo2pdf - npm Package Compare versions

Comparing version 2.2.1 to 2.2.2

dist/clone.js.map

22

dist/clone.js

@@ -55,3 +55,2 @@ #!/usr/bin/env node

dockerfile: "dockerfile",
toml: "toml",
ini: "ini",

@@ -198,4 +197,4 @@ };

catch (error) {
// Force TypeScript to treat error as an instance of Error
console.error("Prettier formatting failed:", error.message);
const errorMessage = error.message.split("\n")[0];
console.warn(`Plain text fallback at ${filePath}: ${errorMessage}`);
}

@@ -205,11 +204,2 @@ }

data = data.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
data = data.replace(/Ð/g, "\n");
data = data.replace(/\r\n/g, "\n");
data = data.replace(/\r/g, "\n");
data = data.replace(/uþs/g, "");
doc.addPage();
doc
.font("Courier")
.fontSize(10)
.text(`${fileName}\n\n`, { lineGap: 4 });
if (removeComments) {

@@ -223,3 +213,2 @@ data = (0, strip_comments_1.default)(data);

try {
// Check if language is supported before attempting to highlight
if (addHighlighting && highlight_js_1.default.getLanguage(extension)) {

@@ -231,3 +220,2 @@ highlightedCode = highlight_js_1.default.highlight(data, {

else {
// Use plaintext highlighting if language is not supported
highlightedCode = highlight_js_1.default.highlight(data, {

@@ -239,3 +227,2 @@ language: "plaintext",

catch (error) {
// Use plaintext highlighting if an error occurs
highlightedCode = highlight_js_1.default.highlight(data, {

@@ -259,6 +246,3 @@ language: "plaintext",

}
if (color)
doc.fillColor(color);
else
doc.fillColor("black");
doc.fillColor(color || "black");
if (text !== "\n")

@@ -265,0 +249,0 @@ doc.text(text, { continued: true });

{
"name": "repo2pdf",
"version": "2.2.1",
"version": "2.2.2",
"description": "A CLI tool for generating a PDF document from a GitHub repository",

@@ -5,0 +5,0 @@ "main": "dist/clone.js",

@@ -54,3 +54,2 @@ #!/usr/bin/env node

dockerfile: "dockerfile",
toml: "toml",
ini: "ini",

@@ -236,2 +235,3 @@ };

const parser = getPrettierParser(extension);
if (parser) {

@@ -241,6 +241,5 @@ try {

} catch (error: unknown) {
// Force TypeScript to treat error as an instance of Error
console.error(
"Prettier formatting failed:",
(error as Error).message,
const errorMessage = (error as Error).message.split("\n")[0];
console.warn(
`Plain text fallback at ${filePath}: ${errorMessage}`,
);

@@ -252,13 +251,3 @@ }

data = data.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
data = data.replace(/Ð/g, "\n");
data = data.replace(/\r\n/g, "\n");
data = data.replace(/\r/g, "\n");
data = data.replace(/uþs/g, "");
doc.addPage();
doc
.font("Courier")
.fontSize(10)
.text(`${fileName}\n\n`, { lineGap: 4 });
if (removeComments) {

@@ -274,3 +263,2 @@ data = strip(data);

try {
// Check if language is supported before attempting to highlight
if (addHighlighting && hljs.getLanguage(extension)) {

@@ -281,3 +269,2 @@ highlightedCode = hljs.highlight(data, {

} else {
// Use plaintext highlighting if language is not supported
highlightedCode = hljs.highlight(data, {

@@ -288,3 +275,2 @@ language: "plaintext",

} catch (error) {
// Use plaintext highlighting if an error occurs
highlightedCode = hljs.highlight(data, {

@@ -294,2 +280,3 @@ language: "plaintext",

}
const hlData = htmlToJson(highlightedCode, removeEmptyLines);

@@ -312,4 +299,3 @@ let lineNum = 1;

}
if (color) doc.fillColor(color);
else doc.fillColor("black");
doc.fillColor(color || "black");

@@ -316,0 +302,0 @@ if (text !== "\n") doc.text(text, { continued: true });

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