mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
Source Maps for client-side errors & columns
This commit is contained in:
@@ -12,6 +12,19 @@ pub inline fn containsChar(self: string, char: u8) bool {
|
||||
pub inline fn contains(self: string, str: string) bool {
|
||||
return std.mem.indexOf(u8, self, str) != null;
|
||||
}
|
||||
pub inline fn containsComptime(self: string, comptime str: string) bool {
|
||||
var remain = self;
|
||||
const Int = std.meta.Int(.unsigned, str.len * 8);
|
||||
|
||||
while (remain.len >= comptime str.len) {
|
||||
if (@bitCast(Int, remain.ptr[0..str.len].*) == @bitCast(Int, str.ptr[0..str.len].*)) {
|
||||
return true;
|
||||
}
|
||||
remain = remain[str.len..];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
pub const includes = contains;
|
||||
|
||||
pub inline fn containsAny(in: anytype, target: string) bool {
|
||||
|
||||
Reference in New Issue
Block a user