mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
endsWith("") should return true
Former-commit-id: fdbb66abc4e539ef960a72588495cd9964eff68b
This commit is contained in:
@@ -203,7 +203,7 @@ pub fn startsWith(self: string, str: string) bool {
|
||||
}
|
||||
|
||||
pub inline fn endsWith(self: string, str: string) bool {
|
||||
return @call(.{ .modifier = .always_inline }, std.mem.endsWith, .{ u8, self, str });
|
||||
return str.len == 0 or @call(.{ .modifier = .always_inline }, std.mem.endsWith, .{ u8, self, str });
|
||||
}
|
||||
|
||||
pub fn endsWithAny(self: string, str: string) bool {
|
||||
|
||||
Reference in New Issue
Block a user