CborEncoderDag.js 707 B

1234567891011121314151617181920212223
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.CborEncoderDag = void 0;
  4. const CborEncoderStable_1 = require("./CborEncoderStable");
  5. class CborEncoderDag extends CborEncoderStable_1.CborEncoderStable {
  6. writeUndef() {
  7. this.writeNull();
  8. }
  9. writeFloat(float) {
  10. if (float !== float)
  11. return this.writeNull();
  12. if (!Number.isFinite(float))
  13. return this.writeNull();
  14. this.writer.u8f64(0xfb, float);
  15. }
  16. writeTag(tag, value) {
  17. if (tag === 42)
  18. this.writeTagHdr(tag);
  19. this.writeAny(value);
  20. }
  21. }
  22. exports.CborEncoderDag = CborEncoderDag;
  23. //# sourceMappingURL=CborEncoderDag.js.map