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

auri

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auri - npm Package Compare versions

Comparing version 0.2.6 to 0.3.0

2

package.json
{
"name": "auri",
"version": "0.2.6",
"version": "0.3.0",
"description": "Organize package changes and releases",

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

@@ -28,22 +28,29 @@ import fs from "fs";

};
const getGitignoreItemPaths = () => {
const readdirRecursiveFileSync = (workingAbsolutePath = process.cwd()) => {
const ignoreItemRelativePaths = [".git"];
if (fs.existsSync(path.resolve(".gitignore"))) {
const file = fs.readFileSync(path.resolve(".gitignore"));
const gitignoreFilePath = path.join(workingAbsolutePath, ".gitignore");
if (fs.existsSync(gitignoreFilePath)) {
const file = fs.readFileSync(gitignoreFilePath);
const fileText = file.toString();
ignoreItemRelativePaths.push(...fileText.split("\n"));
ignoreItemRelativePaths.push(...fileText.split("\n").filter((val) => !!val && !val.startsWith("#")));
}
return ignoreItemRelativePaths.map((relativePath) => path.resolve(relativePath));
};
const readdirRecursiveFileSync = (absolutePath = process.cwd()) => {
const ignoreItemAbsolutePaths = getGitignoreItemPaths();
const relativeFilePaths = [];
const dirItemNames = fs.readdirSync(absolutePath);
const ignoreItemAbsolutePaths = ignoreItemRelativePaths
.map((relativePath) => path.join(workingAbsolutePath, relativePath))
.map((filePath) => {
if (!filePath.endsWith("/"))
return filePath;
return filePath.slice(0, -1);
})
.filter((path) => path !== workingAbsolutePath);
const absoluteFilePaths = [];
const dirItemNames = fs.readdirSync(workingAbsolutePath);
for (const itemName of dirItemNames) {
const absoluteItemPath = path.resolve(absolutePath, itemName);
const relativeItemPath = path.relative(process.cwd(), absoluteItemPath);
const stat = fs.lstatSync(path.resolve(relativeItemPath));
if (stat.isFile()) {
relativeFilePaths.push(relativeItemPath);
const absoluteItemPath = path.join(workingAbsolutePath, itemName);
const stat = fs.lstatSync(absoluteItemPath);
if (stat.isFile() && !ignoreItemAbsolutePaths.includes(absoluteItemPath)) {
absoluteFilePaths.push(absoluteItemPath);
continue;
}
if (stat.isFile())
continue;
const isDir = stat.isDirectory();

@@ -54,6 +61,6 @@ const ignoreDir = isDir &&

const nestedItemPaths = readdirRecursiveFileSync(absoluteItemPath);
relativeFilePaths.push(...nestedItemPaths);
absoluteFilePaths.push(...nestedItemPaths);
}
}
return relativeFilePaths;
return absoluteFilePaths;
};

@@ -60,0 +67,0 @@ export const getPackage = async (packageName) => {

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