Use objectSpread as applicable (#538)

* Use objectSpread as applicable

* Updates

* Add objectSpread import
This commit is contained in:
Jaco authored and GitHub committed 2021-11-05 06:27:07 +02:00
1 parent 2910128399
commit f6e6c83950
14 files changed
+139 -139

No files matched your search

+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 };