mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
fix(bundler): fix --compile with asset files on windows (#10385)
* fix some bundler things * buh * buh --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
This commit is contained in:
@@ -32,6 +32,17 @@ pub inline fn contains(self: string, str: string) bool {
|
||||
return indexOf(self, str) != null;
|
||||
}
|
||||
|
||||
pub inline fn removeLeadingDotSlash(slice: []const u8) []const u8 {
|
||||
if (slice.len >= 2) {
|
||||
if ((@as(u16, @bitCast(slice[0..2].*)) == comptime std.mem.readInt(u16, "./", .little)) or
|
||||
(Environment.isWindows and @as(u16, @bitCast(slice[0..2].*)) == comptime std.mem.readInt(u16, ".\\", .little)))
|
||||
{
|
||||
return slice[2..];
|
||||
}
|
||||
}
|
||||
return slice;
|
||||
}
|
||||
|
||||
pub inline fn w(comptime str: []const u8) [:0]const u16 {
|
||||
if (!@inComptime()) @compileError("strings.w() must be called in a comptime context");
|
||||
comptime var output: [str.len + 1]u16 = undefined;
|
||||
|
||||
Reference in New Issue
Block a user