[bun.js] Bun.write for macOS

This commit is contained in:
Jarred Sumner
2022-03-23 04:26:49 -07:00
parent 5e5f0bd293
commit 07d77c1e00
14 changed files with 232 additions and 76 deletions

View File

@@ -1868,6 +1868,10 @@ pub const ArrayBuffer = extern struct {
return this.ptr[this.offset .. this.offset + this.len];
}
pub inline fn byteSlice(this: *const @This()) []u8 {
return this.ptr[this.offset .. this.offset + this.byte_len];
}
pub inline fn asU16(this: *const @This()) []u16 {
return std.mem.bytesAsSlice(u16, @alignCast(@alignOf([*]u16), this.ptr[this.offset..this.byte_len]));
}