From f11114f6dc7ad83e65fd45494de582ff635df359 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Wed, 17 Apr 2024 20:30:32 +0200 Subject: [PATCH] BREAKING CHANGE(core): update --- ts/00_commitinfo_data.ts | 2 +- ts/index.ts | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 9e56891..d073c8f 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartbuffer', - version: '2.0.3', + version: '3.0.0', description: 'A library for managing ArrayBufferLike structures including conversion between Base64 and Uint8Array, and buffer validation.' } diff --git a/ts/index.ts b/ts/index.ts index 7855bcf..764bdf8 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -10,16 +10,6 @@ export function base64ToUint8Array(base64: string): Uint8Array { return plugins.uInt8ArrayExtras.base64ToUint8Array(base64); } -export function isBufferLike(obj: any): obj is ArrayBufferLike | Buffer { - // Check for ArrayBufferLike objects in any environment - if (obj && typeof obj.byteLength === 'number') { - return true; - } - - // Additional check specific to Node.js environment for Buffer objects - if (typeof Buffer !== 'undefined' && Buffer.isBuffer) { - return Buffer.isBuffer(obj); - } - - return false; +export const isUint8Array = (obj: any): obj is Uint8Array => { + return plugins.uInt8ArrayExtras.isUint8Array(obj); } \ No newline at end of file