diff --git a/bun.lockb b/bun.lockb index 273ddc7..b06c8d0 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 0c7d218..b188a14 100644 --- a/package.json +++ b/package.json @@ -1,34 +1,34 @@ { - "name": "@gramio/files", - "main": "./dist/index.js", - "version": "0.0.9", - "type": "commonjs", - "description": "Set of utils for work with files and Telegram Bot API", - "keywords": [ - "gramio", - "telegram", - "file", - "files", - "upload" - ], - "scripts": { - "generate": "bun scripts/generate.ts", - "prepublishOnly": "tsc", - "lint": "bunx @biomejs/biome check ./src", - "lint:fix": "bun lint --apply", - "jsr": "bun scripts/release-jsr.ts" - }, - "devDependencies": { - "@biomejs/biome": "1.7.3", - "@types/bun": "^1.1.6", - "@types/node": "^20.14.9", - "prettier": "^3.3.2", - "typescript": "^5.5.2" - }, - "dependencies": { - "@gramio/types": "^7.6.0" - }, - "files": [ - "dist" - ] + "name": "@gramio/files", + "main": "./dist/index.js", + "version": "0.0.10", + "type": "commonjs", + "description": "Set of utils for work with files and Telegram Bot API", + "keywords": [ + "gramio", + "telegram", + "file", + "files", + "upload" + ], + "scripts": { + "generate": "bun scripts/generate.ts", + "prepublishOnly": "tsc", + "lint": "bunx @biomejs/biome check ./src", + "lint:fix": "bun lint --apply", + "jsr": "bun scripts/release-jsr.ts" + }, + "devDependencies": { + "@biomejs/biome": "1.7.3", + "@types/bun": "^1.1.6", + "@types/node": "^20.14.9", + "prettier": "^3.3.2", + "typescript": "^5.5.3" + }, + "dependencies": { + "@gramio/types": "^7.6.0" + }, + "files": [ + "dist" + ] } diff --git a/src/utils.ts b/src/utils.ts index e79e25b..cf67a75 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -81,10 +81,10 @@ export async function convertJsonToFormData( for (let [key, value] of Object.entries(params)) { if (value instanceof Promise) value = await value; - if (value instanceof Blob) formData.set(key, value); + if (value instanceof Blob) formData.append(key, value); else if (typeof value === "object") - formData.set(key, JSON.stringify(value)); - else formData.set(key, String(value)); + formData.append(key, JSON.stringify(value)); + else formData.append(key, String(value)); } return formData;