Use objectSpread as applicable (#538)

* Use objectSpread as applicable

* Updates

* Add objectSpread import
This commit is contained in:
Jaco
2021-11-05 05:27:07 +01:00
committed by GitHub
parent 2910128399
commit f6e6c83950
14 changed files with 139 additions and 139 deletions
+2 -1
View File
@@ -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 };