[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot]
2025-08-28 03:52:07 +00:00
committed by GitHub
parent 8391ea10e3
commit 082d9d61bf
2 changed files with 11 additions and 11 deletions

View File

@@ -1351,7 +1351,7 @@ pub fn jsFunctionProcessLoadEnvFile(globalObject: *jsc.JSGlobalObject, callframe
};
defer bun.default_allocator.free(source.contents);
// Create a temporary map for parsing - using VM allocator instead
// Create a temporary map for parsing - using VM allocator instead
var env_map = Map.init(vm.allocator);
defer env_map.map.deinit();
@@ -1383,6 +1383,11 @@ pub const home_env = if (Environment.isWindows) "USERPROFILE" else "HOME";
const string = []const u8;
// Export the function for C binding
comptime {
@export(&jsc.toJSHostFn(jsFunctionProcessLoadEnvFile), .{ .name = "jsFunctionProcessLoadEnvFile" });
}
const Fs = @import("./fs.zig");
const std = @import("std");
const URL = @import("./url.zig").URL;
@@ -1393,13 +1398,8 @@ const Environment = bun.Environment;
const OOM = bun.OOM;
const Output = bun.Output;
const analytics = bun.analytics;
const jsc = bun.jsc;
const logger = bun.logger;
const s3 = bun.S3;
const strings = bun.strings;
const api = bun.schema.api;
const jsc = bun.jsc;
// Export the function for C binding
comptime {
@export(&jsc.toJSHostFn(jsFunctionProcessLoadEnvFile), .{ .name = "jsFunctionProcessLoadEnvFile" });
}

View File

@@ -1,7 +1,7 @@
import { describe, expect, it } from "bun:test";
import { writeFileSync, unlinkSync } from "fs";
import { join } from "path";
import { unlinkSync, writeFileSync } from "fs";
import { tmpdir } from "os";
import { join } from "path";
describe("process.loadEnvFile", () => {
it("should load environment variables from a .env file", () => {
@@ -53,7 +53,7 @@ FULL_URL=\${API_URL}/v1
expect(result).toEqual({
BASE_URL: "https://example.com",
API_URL: "https://example.com/api",
API_URL: "https://example.com/api",
FULL_URL: "https://example.com/api/v1",
});
} finally {
@@ -131,4 +131,4 @@ BAZ=qux
process.loadEnvFile(123);
}).toThrow();
});
});
});