//! Abstract Data Type over Sstr, Istr, Array const value = @import("../value.zig"); const Value = value.Value; pub fn isString(v: Value) bool { if (value.sstr.check(v)) return true; if (value.istr.check(v)) return true; if (value.array.check(.str, v)) |_| return true; return false; } pub fn getBytes(s: *const Value) []const u8 { if (value.sstr.check(s.*)) return value.sstr.unpack(s); if (value.istr.check(s.*)) return value.istr.unpack(s.*).bytes(); if (value.array.check(.str, s.*)) |arr_ptr| return arr_ptr.bytesRO(); s.dump(); @panic("This is not a string."); }