Converts tests to TypeScript (#300)
This commit is contained in:
@@ -20,7 +20,6 @@ try {
|
||||
|
||||
/**
|
||||
* @name u8aToString
|
||||
* @signature u8aToString (value?: UInt8Array): string
|
||||
* @summary Creates a utf-8 string from a Uint8Array object.
|
||||
* @description
|
||||
* `UInt8Array` input values return the actual decoded utf-8 string. `null` or `undefined` values returns an empty string.
|
||||
@@ -33,7 +32,7 @@ try {
|
||||
* u8aToString(new Uint8Array([0x68, 0x65, 0x6c, 0x6c, 0x6f])); // hello
|
||||
* ```
|
||||
*/
|
||||
export default function u8aToString (value?: Uint8Array): string {
|
||||
export default function u8aToString (value?: Uint8Array | null): string {
|
||||
if (!value || !value.length) {
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user