Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
bebc8b0ede | |||
46e5217fc0 | |||
ebb539e824 | |||
63e3b492e6 | |||
158614c62c | |||
f11114f6dc | |||
f233cb1dcd | |||
866da6f21a |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartbuffer",
|
"name": "@push.rocks/smartbuffer",
|
||||||
"version": "2.0.2",
|
"version": "3.0.2",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A library for managing ArrayBufferLike structures including conversion between Base64 and Uint8Array, and buffer validation.",
|
"description": "A library for managing ArrayBufferLike structures including conversion between Base64 and Uint8Array, and buffer validation.",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartbuffer',
|
name: '@push.rocks/smartbuffer',
|
||||||
version: '2.0.2',
|
version: '3.0.2',
|
||||||
description: 'A library for managing ArrayBufferLike structures including conversion between Base64 and Uint8Array, and buffer validation.'
|
description: 'A library for managing ArrayBufferLike structures including conversion between Base64 and Uint8Array, and buffer validation.'
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,10 @@ export function base64ToUint8Array(base64: string): Uint8Array {
|
|||||||
return plugins.uInt8ArrayExtras.base64ToUint8Array(base64);
|
return plugins.uInt8ArrayExtras.base64ToUint8Array(base64);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const isUint8Array = (obj: any): obj is Uint8Array => {
|
||||||
|
return plugins.uInt8ArrayExtras.isUint8Array(obj);
|
||||||
|
}
|
||||||
|
|
||||||
export function isBufferLike(obj: any): obj is ArrayBufferLike | Buffer {
|
export function isBufferLike(obj: any): obj is ArrayBufferLike | Buffer {
|
||||||
// Check for ArrayBufferLike objects in any environment
|
// Check for ArrayBufferLike objects in any environment
|
||||||
if (obj && typeof obj.byteLength === 'number') {
|
if (obj && typeof obj.byteLength === 'number') {
|
||||||
|
Reference in New Issue
Block a user