summaryrefslogtreecommitdiff
path: root/src/textutils.zig
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/utils.zig (renamed from src/textutils.zig)8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/textutils.zig b/src/utils.zig
index 41dd5f5..c6e8508 100644
--- a/src/textutils.zig
+++ b/src/utils.zig
@@ -14,3 +14,11 @@ pub fn escapeXml(writer: anytype, text: []const u8) !void {
14 }; 14 };
15 } 15 }
16} 16}
17
18pub inline fn isNull(value: anytype) bool {
19 return switch (@typeInfo(@TypeOf(value))) {
20 .Null => true,
21 .Optional => value == null,
22 else => false,
23 };
24}