From 09bb5c8320fe895d5c510d223a919fff66de079e Mon Sep 17 00:00:00 2001 From: toyobayashi Date: Fri, 11 Oct 2024 22:17:18 +0800 Subject: [PATCH] fix: napi_is_buffer(Uint8Array) should return `true` --- packages/runtime/src/Handle.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/runtime/src/Handle.ts b/packages/runtime/src/Handle.ts index 727457bb..96cd03ae 100644 --- a/packages/runtime/src/Handle.ts +++ b/packages/runtime/src/Handle.ts @@ -48,6 +48,7 @@ export class Handle { } public isBuffer (BufferConstructor?: BufferCtor): boolean { + if (ArrayBuffer.isView(this.value)) return true BufferConstructor ??= _Buffer return typeof BufferConstructor === 'function' && BufferConstructor.isBuffer(this.value) }