mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
kit: implement server components dev server (#14025)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user