How to use the capnp-ts/lib/std/schema.capnp.CodeGeneratorRequest function in capnp-ts

To help you get started, we’ve selected a few capnp-ts 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 jdiaz5513 / capnp-ts / packages / capnpc-ts / src / index.ts View on Github external
let i = 0;

      chunks.forEach(chunk => {
        chunk.copy(reqBuffer, i);

        i += chunk.byteLength;
      });

      trace("reqBuffer (length: %d)", reqBuffer.length, reqBuffer);

      const message = new capnp.Message(reqBuffer, false);

      trace("message: %s", message.dump());

      const req = message.getRoot(s.CodeGeneratorRequest);

      trace("%s", req);

      const ctx = loadRequest(req);

      writeTsFiles(ctx);

      return ctx;
    });
  });