From 0a16aedf9505adfa4cb11d11f26c6e26f287ed1a Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:26:13 -0400 Subject: [PATCH] Remove isbinaryfile as this caused errors on some users computers --- package-lock.json | 17 ++--------------- package.json | 3 +-- src/utils/extract-text.ts | 8 +------- 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2c42190..c363c4a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index 401312a..0098e7c 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/utils/extract-text.ts b/src/utils/extract-text.ts index 8f4205f..65d5469 100644 --- a/src/utils/extract-text.ts +++ b/src/utils/extract-text.ts @@ -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 { @@ -20,12 +19,7 @@ export async function extractTextFromFile(filePath: string): Promise { 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}`) - } + return await fs.readFile(filePath, "utf8") } }