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

print-project

Package Overview
Dependencies
Maintainers
0
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

print-project - npm Package Compare versions

Comparing version 1.0.21 to 1.0.22

project-print.txt

26

dist/index.js

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

let ignorePatterns = ["project-print.txt"]; // Always ignore the output file
// Add user's ignore patterns
ignorePatterns = [...ignorePatterns, ...userIgnorePatterns];
// If NOT using --ignore-default, add default patterns
// If NOT using --ignore-default, add default patterns FIRST
if (!options.ignoreDefault) {
ignorePatterns = [...ignorePatterns, ...constants_1.defaultIgnorePatterns];
ignorePatterns = [...constants_1.defaultIgnorePatterns, ...ignorePatterns];
}
// Add user's ignore patterns LAST to give them precedence
ignorePatterns = [...ignorePatterns, ...userIgnorePatterns];
function matchesAnyPattern(filePath, patterns) {
if (patterns.length === 0) {
return false;
}
return patterns.some(pattern => {
if (!pattern) {
return false;
}
const normalizedPath = filePath.replace(/\\/g, "/").toLowerCase();

@@ -69,8 +75,3 @@ const normalizedPattern = pattern.toLowerCase();

if (includePatterns.length > 0) {
const isIncluded = matchesAnyPattern(filePath, includePatterns);
if (!isIncluded) {
return false;
}
// If file matches include pattern, include it regardless of ignore patterns
return true;
return matchesAnyPattern(filePath, includePatterns);
}

@@ -85,6 +86,5 @@ // If no include patterns, exclude if matches ignore patterns

const fullPath = path.join(dirPath, entry.name);
const relativePath = path.relative(process.cwd(), fullPath).replace(/\\/g, "/");
const relativePath = path.relative(startPath || ".", fullPath).replace(/\\/g, "/");
if (entry.isDirectory()) {
// Always process directory if we have include patterns, otherwise check ignore patterns
if (includePatterns.length > 0 || !matchesAnyPattern(relativePath, ignorePatterns)) {
if (shouldProcess(relativePath)) {
const subTree = {};

@@ -91,0 +91,0 @@ treeStructure[relativePath] = subTree;

{
"name": "print-project",
"version": "1.0.21",
"version": "1.0.22",
"description": "A simple CLI tool to print the project tree structure and file contents",

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

@@ -22,12 +22,20 @@ #!/usr/bin/env node

// Add user's ignore patterns
ignorePatterns = [...ignorePatterns, ...userIgnorePatterns];
// If NOT using --ignore-default, add default patterns
// If NOT using --ignore-default, add default patterns FIRST
if (!options.ignoreDefault) {
ignorePatterns = [...ignorePatterns, ...defaultIgnorePatterns];
ignorePatterns = [...defaultIgnorePatterns, ...ignorePatterns];
}
// Add user's ignore patterns LAST to give them precedence
ignorePatterns = [...ignorePatterns, ...userIgnorePatterns];
function matchesAnyPattern(filePath: string, patterns: string[]): boolean {
if (patterns.length === 0) {
return false;
}
return patterns.some(pattern => {
if (!pattern) {
return false;
}
const normalizedPath = filePath.replace(/\\/g, "/").toLowerCase();

@@ -53,8 +61,3 @@ const normalizedPattern = pattern.toLowerCase();

if (includePatterns.length > 0) {
const isIncluded = matchesAnyPattern(filePath, includePatterns);
if (!isIncluded) {
return false;
}
// If file matches include pattern, include it regardless of ignore patterns
return true;
return matchesAnyPattern(filePath, includePatterns);
}

@@ -72,7 +75,6 @@

const fullPath = path.join(dirPath, entry.name);
const relativePath = path.relative(process.cwd(), fullPath).replace(/\\/g, "/");
const relativePath = path.relative(startPath || ".", fullPath).replace(/\\/g, "/");
if (entry.isDirectory()) {
// Always process directory if we have include patterns, otherwise check ignore patterns
if (includePatterns.length > 0 || !matchesAnyPattern(relativePath, ignorePatterns)) {
if (shouldProcess(relativePath)) {
const subTree = {};

@@ -79,0 +81,0 @@ treeStructure[relativePath] = subTree;

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