How to use the @chainsafe/lodestar/src/util/expandYamlValue.expandYamlValue function in @chainsafe/lodestar

To help you get started, we’ve selected a few @chainsafe/lodestar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ChainSafe / lodestar / packages / ssz-cli / src / hashTreeRoot.ts View on Github external
demand: true,
      type: "string",
    },
  }).argv;
  try {
    // process input
    let input = await readInput(argv.i);
    // parse input
    const inputParser = "yaml";
    const parsedInput = inputParsers[inputParser].parse(input);
    // process config
    const config = presets[argv.config];
    // process type
    const type = config[argv.t];
    // perform action
    const output = hashTreeRoot(expandYamlValue(parsedInput,type), type);
    // parse output
    const outputParser = "hex";
    const parsedOutput = outputParsers[outputParser].dump(output);
    // write output
    await writeOutput(parsedOutput, argv.o);
  } catch (e) {
    console.error(e.message);
  }
})();
github ChainSafe / lodestar / packages / ssz-cli / src / serialize.ts View on Github external
demand: true,
      type: "string",
    },
  }).argv;
  try {
    // process input
    const input = await readInput(argv.i);
    // parse input
    const inputParser = "yaml";
    const parsedInput = inputParsers[inputParser].parse(input);
    // process config
    const config = presets[argv.config];
    // process type
    const type = config[argv.t];
    // perform action
    const output = serialize(expandYamlValue(parsedInput,type), type);
    // parse output
    const outputParser = "hex";
    const parsedOutput = outputParsers[outputParser].dump(output);
    // write output
    await writeOutput(parsedOutput, argv.o);
  } catch (e) {
    console.error(e.message);
  }
})();