mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
windows: fix bun plugin (#8485)
* plugins work now * real * Update src/js/builtins/BundlerPlugin.ts * [autofix.ci] apply automated fixes --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -5841,3 +5841,17 @@ pub const QuoteEscapeFormat = struct {
|
||||
try writer.writeAll(self.data[i..]);
|
||||
}
|
||||
};
|
||||
|
||||
/// Generic. Works on []const u8, []const u16, etc
|
||||
pub inline fn indexOfScalar(input: anytype, scalar: std.meta.Child(@TypeOf(input))) ?usize {
|
||||
if (comptime std.meta.Child(@TypeOf(input)) == u8) {
|
||||
return strings.indexOfCharUsize(input, scalar);
|
||||
} else {
|
||||
return std.mem.indexOfScalar(std.meta.Child(@TypeOf(input)), input, scalar);
|
||||
}
|
||||
}
|
||||
|
||||
/// Generic. Works on []const u8, []const u16, etc
|
||||
pub fn containsScalar(input: anytype, item: std.meta.Child(@TypeOf(input))) bool {
|
||||
return indexOfScalar(input, item) != null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user