async convert()

in src/convert.ts [208:227]


  async convert(
    requests: ParsedRequest[],
    options: ConvertOptions,
  ): Promise<string> {
    const input = base64url.encode(
      JSON.stringify({ requests: getSlimRequests(requests), options }),
    );
    if (execAsync === undefined) {
      throw new Error("Cannot use exec()");
    }
    const { stdout } = await execAsync(`${this.baseCmd} convert ${input}`);
    if (stdout) {
      const json = JSON.parse(base64url.decode(stdout));
      if (json.error) {
        throw new Error(json.error);
      }
      return json.return;
    }
    throw new Error("Could not invoke exporter");
  }