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:
@@ -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
|
||||
|
||||
@@ -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][];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user