Remove isbinaryfile as this caused errors on some users computers

This commit is contained in:
Saoud Rizwan
2024-09-06 12:26:13 -04:00
parent 9eaf753000
commit 0a16aedf95
3 changed files with 4 additions and 24 deletions

17
package-lock.json generated
View File

@@ -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",

View File

@@ -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",

View File

@@ -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}`)
}
}
}