Skip to content

Commit

Permalink
try fixing iterator error
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Jun 20, 2024
1 parent 071dcdc commit 1e48d79
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/generate_addresses_types.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import mainnet from "../data/addresses.mainnet.json";
import testnet from "../data/addresses.testnet.json";

// Ensure that mainnet and testnet are typed as arrays
const mainnetData: any[] = mainnet as any[];
const testnetData: any[] = testnet as any[];

const extractUniqueValues = (data: any[], key: string): string[] => {
const allValues = data.filter((item) => item[key] !== undefined).map((item) => item[key].toString());
return [...new Set(allValues)];
};

const generateTypesForKeys = (keys: string[]) => {
const networks = [...mainnet, ...testnet];
const networks = [...mainnetData, ...testnetData];

let typeDefs = "";

Expand Down

0 comments on commit 1e48d79

Please sign in to comment.