Helpers for 256/512 hashing (#1303)

* Helpers for 256/512 hashing

* Adjust u8aToU8a (u8a-only check earlier)

* Fix export

* Simplify

* revert
This commit is contained in:
Jaco
2021-12-09 10:10:51 +02:00
committed by GitHub
parent 000d097de2
commit 7955022ce5
13 changed files with 93 additions and 102 deletions
+1 -3
View File
@@ -1,9 +1,7 @@
// Copyright 2017-2021 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
type Entries<T> = {
[K in keyof T]: [K, T[K]]
}[keyof T][];
type Entries<T> = { [K in keyof T]: [K, T[K]] }[keyof T][];
/**
* @name objectEntries
+2 -4
View File
@@ -1,12 +1,10 @@
// Copyright 2017-2021 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
type Values<T extends object> = T[keyof T][];
/**
* @name objectValues
* @summary A version of Object.values that is typed for TS
*/
export function objectValues<T extends object> (obj: T): Values<T> {
return Object.values(obj) as Values<T>;
export function objectValues<T extends object> (obj: T): T[keyof T][] {
return Object.values(obj) as T[keyof T][];
}