mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 13:51:47 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -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" });
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user