Skip to content

Commit

Permalink
fix(core): check existance of Buffer.isBuffer, fix #664 (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Apr 30, 2024
1 parent cc13539 commit 86d5271
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/oniguruma/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 86d5271

Please sign in to comment.