* 7.2.1

* Update CHANGELOG.md

* u8aEmpty
This commit is contained in:
Jaco
2021-08-15 10:38:48 +02:00
committed by GitHub
parent 2ad042e44d
commit c4a8aa2dd7
20 changed files with 104 additions and 66 deletions
+12
View File
@@ -0,0 +1,12 @@
// Copyright 2017-2021 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
/**
* @name u8aEmpty
* @summary Tests for a `Uint8Array` for emptyness
* @description
* Checks to see if the input `Uint8Array` has zero length or contains all 0 values.
*/
export function u8aEmpty (value: Uint8Array): boolean {
return value.length === 0 || value.every((v) => !v);
}