Skip to content

Commit

Permalink
fix: napi_is_buffer(Uint8Array) should return true
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed Oct 11, 2024
1 parent df9dd83 commit 09bb5c8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/runtime/src/Handle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class Handle<S> {
}

public isBuffer (BufferConstructor?: BufferCtor): boolean {
if (ArrayBuffer.isView(this.value)) return true
BufferConstructor ??= _Buffer
return typeof BufferConstructor === 'function' && BufferConstructor.isBuffer(this.value)
}
Expand Down

0 comments on commit 09bb5c8

Please sign in to comment.