From 6a5889b1f3ca26109551b5999950f4f3eaa5acdf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 19:47:27 +0000 Subject: [PATCH] fix(deps): update dependency file-type to v19 (#208) * fix(deps): update dependency file-type to v19 * fix: use fileTypeFromBuffer --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: DanCodes --- package.json | 2 +- src/index.ts | 6 +++--- yarn.lock | 44 ++++++++++++++++++++++---------------------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/package.json b/package.json index 4828e3ec..c82d690f 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,6 @@ "packageManager": "yarn@4.2.1", "dependencies": { "axios": "^1.6.8", - "file-type": "^16.5.4" + "file-type": "^19.0.0" } } diff --git a/src/index.ts b/src/index.ts index 32281033..85cd9804 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ import axios, { AxiosError, AxiosHeaders, type AxiosRequestConfig, type AxiosRequestHeaders } from 'axios'; -import fileType from 'file-type'; -import { ReadStream } from 'fs'; +import { fileTypeFromBuffer } from 'file-type'; import { createHash } from 'node:crypto'; +import { ReadStream } from 'node:fs'; import { BunnyCdnStreamError } from './error'; import { BunnyCdnStreamVideo } from './structures/Video'; import { lowerObject } from './utils'; @@ -330,7 +330,7 @@ export class BunnyCdnStream { if (typeof thumbnail !== 'string') options.headers['Content-Type'] = - thumbnail instanceof ReadStream ? 'application/octet-stream' : (ct || (await fileType.fromBuffer(thumbnail)) || { mime: 'image/jpg' }).mime; + thumbnail instanceof ReadStream ? 'application/octet-stream' : (ct || (await fileTypeFromBuffer(thumbnail)) || { mime: 'image/jpg' }).mime; options.url += `/library/${this.options.videoLibrary}/videos/${videoId}/thumbnail`; options.method = 'POST'; diff --git a/yarn.lock b/yarn.lock index 5e54f107..07c77611 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3269,7 +3269,7 @@ __metadata: eslint: "npm:^8.57.0" eslint-config-prettier: "npm:^9.1.0" eslint-plugin-prettier: "npm:^4.2.1" - file-type: "npm:^16.5.4" + file-type: "npm:^19.0.0" husky: "npm:^9.0.11" jest: "npm:^29.7.0" jest-circus: "npm:^29.7.0" @@ -5017,14 +5017,14 @@ __metadata: languageName: node linkType: hard -"file-type@npm:^16.5.4": - version: 16.5.4 - resolution: "file-type@npm:16.5.4" +"file-type@npm:^19.0.0": + version: 19.0.0 + resolution: "file-type@npm:19.0.0" dependencies: - readable-web-to-node-stream: "npm:^3.0.0" - strtok3: "npm:^6.2.4" - token-types: "npm:^4.1.1" - checksum: 10c0/a6c9ab8bc05bc9c212bec239fb0d5bf59ddc9b3912f00c4ef44622e67ae4e553a1cc8372e9e595e14859035188eb305d05d488fa3c5c2a2ad90bb7745b3004ef + readable-web-to-node-stream: "npm:^3.0.2" + strtok3: "npm:^7.0.0" + token-types: "npm:^5.0.1" + checksum: 10c0/1884c3627f5922365f86cb19f107850fe7b72d78bef5c2affc92aa098ba414c944e3763101068236345737f44a5b6da13bb0ba79de4c4e3b1b1c68e1958643d9 languageName: node linkType: hard @@ -8688,10 +8688,10 @@ __metadata: languageName: node linkType: hard -"peek-readable@npm:^4.1.0": - version: 4.1.0 - resolution: "peek-readable@npm:4.1.0" - checksum: 10c0/f9b81ce3eed185cc9ebbf7dff0b6e130dd6da7b05f1802bbf726a78e4d84990b0a65f8e701959c50eb1124cc2ad352205147954bf39793faba29bb00ce742a44 +"peek-readable@npm:^5.0.0": + version: 5.0.0 + resolution: "peek-readable@npm:5.0.0" + checksum: 10c0/060aece3a907a157b4839aa923b61b664b59cac7296dc8d8e0ddcc39065a4f1e328dd2f171c8a49e869aabc6e076a1be59f939183fb0ababc81f3c870006d672 languageName: node linkType: hard @@ -9017,7 +9017,7 @@ __metadata: languageName: node linkType: hard -"readable-web-to-node-stream@npm:^3.0.0": +"readable-web-to-node-stream@npm:^3.0.2": version: 3.0.2 resolution: "readable-web-to-node-stream@npm:3.0.2" dependencies: @@ -10025,13 +10025,13 @@ __metadata: languageName: node linkType: hard -"strtok3@npm:^6.2.4": - version: 6.3.0 - resolution: "strtok3@npm:6.3.0" +"strtok3@npm:^7.0.0": + version: 7.0.0 + resolution: "strtok3@npm:7.0.0" dependencies: "@tokenizer/token": "npm:^0.3.0" - peek-readable: "npm:^4.1.0" - checksum: 10c0/8f1483a2a6758404502f2fc431586fcf37d747b10b125596ab5ec92319c247dd1195f82ba0bc2eaa582db3d807b5cca4b67ff61411756fec6622d051f8e255c2 + peek-readable: "npm:^5.0.0" + checksum: 10c0/63a72b10a302719242bfd31ca53955a06bb091dfec46ef14ca10c4b17ab15780ed8365cd5b270cfbde92d571f677539957add436e4bf9cccdf9977b40d762583 languageName: node linkType: hard @@ -10214,13 +10214,13 @@ __metadata: languageName: node linkType: hard -"token-types@npm:^4.1.1": - version: 4.2.1 - resolution: "token-types@npm:4.2.1" +"token-types@npm:^5.0.1": + version: 5.0.1 + resolution: "token-types@npm:5.0.1" dependencies: "@tokenizer/token": "npm:^0.3.0" ieee754: "npm:^1.2.1" - checksum: 10c0/e9a4a139deba9515770cd7ac36a8f53f953b9d035d309e88a66d706760dba0df420753f2b8bdee6b9f3cbff8d66b24e69571e8dea27baa7b378229ab1bcca399 + checksum: 10c0/cb671b2b52271362816d22b7a076082b0da033cd7807992b81ae53cfd8541bd013ac29e455c3c7a8bb4f88aa1c5315a12353c3599b7f568df238d3c1723f9d8d languageName: node linkType: hard