Skip to content

Commit 9d74407

Browse files
committed
chore: fix buffer lint
1 parent c583e5a commit 9d74407

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/api/upload.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { Buffer, type Blob as NodeBlob } from 'node:buffer'
1+
/* eslint-disable node/prefer-global/buffer */
22
import ky from 'ky'
33
import { request, toResponse } from '../request'
4+
import type { Buffer, Blob as NodeBlob } from 'node:buffer'
45
import type { Upload } from '../types/api-responses'
56

67
export const token = <T = Upload.TokenResponse>(md5: string) =>
@@ -15,7 +16,10 @@ export const upload = async (
1516
token: string,
1617
) => {
1718
let file: Blob
18-
if (typeof Buffer !== 'undefined' && Buffer.isBuffer(image)) {
19+
if (
20+
typeof globalThis.Buffer !== 'undefined' &&
21+
globalThis.Buffer.isBuffer(image)
22+
) {
1923
file = new Blob([image.buffer])
2024
} else {
2125
file = image as Blob

0 commit comments

Comments
 (0)