From 86d5271ef393fd0edf9593b0bd43d431f2a395cc Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 30 Apr 2024 05:23:37 -0400 Subject: [PATCH] fix(core): check existance of `Buffer.isBuffer`, fix #664 (#666) --- packages/core/src/oniguruma/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/oniguruma/index.ts b/packages/core/src/oniguruma/index.ts index 50036c3dd..f25b1e81b 100644 --- a/packages/core/src/oniguruma/index.ts +++ b/packages/core/src/oniguruma/index.ts @@ -378,7 +378,7 @@ function isResponse(dataOrOptions: any): dataOrOptions is Response { function isArrayBuffer(data: any): data is ArrayBuffer | ArrayBufferView { return (typeof ArrayBuffer !== 'undefined' && (data instanceof ArrayBuffer || ArrayBuffer.isView(data))) // eslint-disable-next-line node/prefer-global/buffer - || (typeof Buffer !== 'undefined' && Buffer.isBuffer(data)) + || (typeof Buffer !== 'undefined' && Buffer.isBuffer?.(data)) || (typeof SharedArrayBuffer !== 'undefined' && data instanceof SharedArrayBuffer) || (typeof Uint32Array !== 'undefined' && data instanceof Uint32Array) }