mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 04:11:10 -05:00
Remove isbinaryfile as this caused errors on some users computers
This commit is contained in:
17
package-lock.json
generated
17
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "claude-dev",
|
||||
"version": "1.5.3",
|
||||
"version": "1.5.33",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "claude-dev",
|
||||
"version": "1.5.3",
|
||||
"version": "1.5.33",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@anthropic-ai/bedrock-sdk": "^0.10.2",
|
||||
@@ -22,7 +22,6 @@
|
||||
"diff": "^5.2.0",
|
||||
"execa": "^9.3.0",
|
||||
"globby": "^14.0.2",
|
||||
"isbinaryfile": "^5.0.2",
|
||||
"mammoth": "^1.8.0",
|
||||
"openai": "^4.54.0",
|
||||
"os-name": "^6.0.0",
|
||||
@@ -7370,18 +7369,6 @@
|
||||
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/isbinaryfile": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-5.0.2.tgz",
|
||||
"integrity": "sha512-GvcjojwonMjWbTkfMpnVHVqXW/wKMYDfEpY94/8zy8HFMOqb/VL6oeONq9v87q4ttVlaTLnGXnJD4B5B1OTGIg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 18.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/gjtorikian/"
|
||||
}
|
||||
},
|
||||
"node_modules/isexe": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "claude-dev",
|
||||
"displayName": "Claude Dev",
|
||||
"description": "Autonomous coding agent right in your IDE, capable of creating/editing files, executing commands, and more with your permission every step of the way.",
|
||||
"version": "1.5.32",
|
||||
"version": "1.5.33",
|
||||
"icon": "icon.png",
|
||||
"engines": {
|
||||
"vscode": "^1.84.0"
|
||||
@@ -146,7 +146,6 @@
|
||||
"diff": "^5.2.0",
|
||||
"execa": "^9.3.0",
|
||||
"globby": "^14.0.2",
|
||||
"isbinaryfile": "^5.0.2",
|
||||
"mammoth": "^1.8.0",
|
||||
"openai": "^4.54.0",
|
||||
"os-name": "^6.0.0",
|
||||
|
||||
@@ -2,7 +2,6 @@ import * as path from "path"
|
||||
// @ts-ignore-next-line
|
||||
import pdf from "pdf-parse/lib/pdf-parse"
|
||||
import mammoth from "mammoth"
|
||||
import { isBinaryFile } from "isbinaryfile"
|
||||
import fs from "fs/promises"
|
||||
|
||||
export async function extractTextFromFile(filePath: string): Promise<string> {
|
||||
@@ -20,12 +19,7 @@ export async function extractTextFromFile(filePath: string): Promise<string> {
|
||||
case ".ipynb":
|
||||
return extractTextFromIPYNB(filePath)
|
||||
default:
|
||||
const isBinary = await isBinaryFile(filePath)
|
||||
if (!isBinary) {
|
||||
return await fs.readFile(filePath, "utf8")
|
||||
} else {
|
||||
throw new Error(`Unsupported file type: ${fileExtension}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user