atproto utils for zig zat.dev
atproto sdk zig

feat: add getUint to CBOR Value for unsigned integer extraction

getInt returns ?i64 which truncates values > i64 max. upstream AT Protocol
firehose seq numbers now exceed i64 max, so callers need direct u64 access.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+10
+10
src/internal/repo/cbor.zig
··· 81 81 }; 82 82 } 83 83 84 + /// get an unsigned integer from a map by key 85 + pub fn getUint(self: Value, key: []const u8) ?u64 { 86 + const v = self.get(key) orelse return null; 87 + return switch (v) { 88 + .unsigned => |u| u, 89 + .negative => |n| std.math.cast(u64, n), 90 + else => null, 91 + }; 92 + } 93 + 84 94 /// get a bool from a map by key 85 95 pub fn getBool(self: Value, key: []const u8) ?bool { 86 96 const v = self.get(key) orelse return null;