mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-06-14 19:31:03 +00:00
Use objectSpread as applicable (#538)
* Use objectSpread as applicable * Updates * Add objectSpread import
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { selectableNetworks } from '@polkadot/networks';
|
||||
import { objectSpread } from '@polkadot/util';
|
||||
|
||||
type ChainDef = string[];
|
||||
|
||||
const chains: Record <string, ChainDef> = selectableNetworks
|
||||
.filter((n) => n.genesisHash.length)
|
||||
.reduce((chains, { genesisHash, network }) => ({ ...chains, [network]: genesisHash }), {});
|
||||
.reduce((chains, { genesisHash, network }) => objectSpread(chains, { [network]: genesisHash }), {});
|
||||
|
||||
export { chains };
|
||||
|
||||
Reference in New Issue
Block a user