kit: implement server components dev server (#14025)

This commit is contained in:
dave caruso
2024-09-27 20:53:39 -07:00
committed by GitHub
parent d09df1af47
commit 514d37b3d2
82 changed files with 3812 additions and 5964 deletions

View File

@@ -4649,6 +4649,12 @@ pub fn trim(slice: anytype, comptime values_to_strip: []const u8) @TypeOf(slice)
return slice[begin..end];
}
pub fn isAllWhitespace(slice: []const u8) bool {
var begin: usize = 0;
while (begin < slice.len and std.mem.indexOfScalar(u8, &whitespace_chars, slice[begin]) != null) : (begin += 1) {}
return begin == slice.len;
}
pub const whitespace_chars = [_]u8{ ' ', '\t', '\n', '\r', std.ascii.control_code.vt, std.ascii.control_code.ff };
pub fn lengthOfLeadingWhitespaceASCII(slice: string) usize {