mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-22 10:17:57 +00:00
chore: update to version 14.0.11 and align website URLs
This commit is contained in:
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* @summary Utility methods to convert to and from `Buffer` objects
|
||||
*/
|
||||
export { bufferToU8a } from './toU8a.js';
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* @summary Utility methods to convert to and from `Buffer` objects
|
||||
*/
|
||||
export { bufferToU8a } from './toU8a.js';
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* @name bufferToU8a
|
||||
* @summary Creates a Uint8Array value from a Buffer object.
|
||||
* @description
|
||||
* `null` inputs returns an empty result, `Buffer` values return the actual value as a `Uint8Array`. Anything that is not a `Buffer` object throws an error.
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* import { bufferToU8a } from '@pezkuwi/util';
|
||||
*
|
||||
* bufferToU8a(Buffer.from([1, 2, 3]));
|
||||
* ```
|
||||
*/
|
||||
export declare function bufferToU8a(buffer?: Uint8Array | number[] | null): Uint8Array;
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @name bufferToU8a
|
||||
* @summary Creates a Uint8Array value from a Buffer object.
|
||||
* @description
|
||||
* `null` inputs returns an empty result, `Buffer` values return the actual value as a `Uint8Array`. Anything that is not a `Buffer` object throws an error.
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* import { bufferToU8a } from '@pezkuwi/util';
|
||||
*
|
||||
* bufferToU8a(Buffer.from([1, 2, 3]));
|
||||
* ```
|
||||
*/
|
||||
export function bufferToU8a(buffer) {
|
||||
return new Uint8Array(buffer || []);
|
||||
}
|
||||
Reference in New Issue
Block a user