ok, i’m losing it i think, given an array like thi...
# typescript
p
ok, i’m losing it i think, given an array like this
Output<string>[]
how the hell do i JSON.stringify it so i get a single string with the json serialised into it
Copy code
const list: string[] = [];
    for (const x of resourceList) {
      interpolate`${x.y}@${x.z}`.apply((z) => {
        list.push(z);
      });
    }
    const json = JSON.stringify(list)
my array is either emtpry or i end up with a Output<string>[] which can’t be stringified as is
m
What will the JSON be used for?
p
needed it in a configmap, but just figured it out
Copy code
'static-nodes.json': all(validatorWallets.map((wallet) => wallet.wallet.enode)).apply((enodes) => {
            return JSON.stringify(
              enodes.map((enode, index) => `enode://${enode}@besu-${index + 1}:30303`),
              null,
              2
            );
          }),
the clue was the map in the all