const std = @import("std"); const Allocator = std.mem.Allocator; const ArrayList = std.ArrayList; pub fn escapeXml(writer: anytype, text: []const u8) !void { for (text) |ch| { try switch (ch) { '<' => writer.writeAll("<"), '>' => writer.writeAll(">"), '&' => writer.writeAll("&"), '"' => writer.writeAll("""), else => writer.writeByte(ch), }; } } pub inline fn isNull(value: anytype) bool { return switch (@typeInfo(@TypeOf(value))) { .Null => true, .Optional => value == null, else => false, }; }