diff --git a/ulid.zig b/ulid.zig index f81acb57c97966eeead3e49abd1898a906816160..1dd4546ab0c1dd01456ba1a7aa351eae02a10cb7 100644 --- a/ulid.zig +++ b/ulid.zig @@ -71,4 +71,8 @@ pub const ULID = struct { pub fn nprint(self: ULID, writer: anytype) !void { try writer.writeAll(&self.bytes()); } + + pub fn stringifyJson(self: ULID, writer: anytype, options: std.json.Stringify.Options, json: type) !void { + return json.stringify(writer, &self.bytes(), options); + } };