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

ai-renamer

Package Overview
Dependencies
Maintainers
0
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ai-renamer - npm Package Compare versions

Comparing version 1.0.15 to 1.0.16

2

package.json
{
"version": "1.0.15",
"version": "1.0.16",
"license": "GPL-3.0",

@@ -4,0 +4,0 @@ "name": "ai-renamer",

@@ -9,6 +9,7 @@ const path = require('path')

module.exports = async ({ model, _case, chars, language, filePath }) => {
module.exports = async ({ model, _case, chars, language, filePath, inputPath }) => {
try {
const fileName = path.basename(filePath)
const ext = path.extname(filePath).toLowerCase()
const relativeFilePath = path.relative(inputPath, filePath)

@@ -18,3 +19,3 @@ if (fileName === '.DS_Store') return

if (!isProcessableFile({ filePath })) {
console.log(`🟡 Unsupported file: ${fileName}`)
console.log(`🟡 Unsupported file: ${relativeFilePath}`)
return

@@ -30,3 +31,3 @@ }

if (!content) {
console.log(`🔴 No text content: ${fileName}`)
console.log(`🔴 No text content: ${relativeFilePath}`)
return

@@ -38,3 +39,3 @@ }

if (!newName) {
console.log(`🔴 No new name: ${fileName}`)
console.log(`🔴 No new name: ${relativeFilePath}`)
return

@@ -44,3 +45,4 @@ }

const newFileName = await saveFile({ ext, newName, filePath })
console.log(`🟢 Renamed: ${fileName} to ${newFileName}`)
const relativeNewFilePath = path.join(path.dirname(relativeFilePath), newFileName)
console.log(`🟢 Renamed: ${relativeFilePath} to ${relativeNewFilePath}`)
} catch (err) {

@@ -47,0 +49,0 @@ throw new Error(err.message)

@@ -27,3 +27,3 @@ const fs = require('fs').promises

const stats = await fs.stat(inputPath)
const options = { model, _case, chars, language, includeSubdirectories }
const options = { model, _case, chars, language, inputPath, includeSubdirectories }

@@ -30,0 +30,0 @@ if (stats.isDirectory()) {

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