mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
fix: crash in bun init by renaming string function to be more consistant (#7746)
This commit is contained in:
@@ -713,6 +713,10 @@ pub inline fn startsWithChar(self: string, char: u8) bool {
|
||||
}
|
||||
|
||||
pub inline fn endsWithChar(self: string, char: u8) bool {
|
||||
return self.len > 0 and self[self.len - 1] == char;
|
||||
}
|
||||
|
||||
pub inline fn endsWithCharOrIsZeroLength(self: string, char: u8) bool {
|
||||
return self.len == 0 or self[self.len - 1] == char;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user