Version 1.0.2 mit node_modules Verzeichnis

This commit is contained in:
ISA
2024-10-02 07:58:24 +02:00
parent f353a06b1b
commit 62b6e55a0a
68228 changed files with 4548477 additions and 651 deletions

View File

@@ -0,0 +1,25 @@
/**
* Proxy the environment to track environment variables keys that
* are accessed during the build.
*
* @param envVars A set to track environment variable keys that are accessed.
* @returns A function that restores the original environment.
*/ export function envProxy(envVars) {
const newEnv = new Proxy(process.env, {
get: (target, key, receiver)=>{
envVars.add(key);
return Reflect.get(target, key, receiver);
},
set: (target, key, value)=>{
return Reflect.set(target, key, value);
}
});
const oldEnv = process.env;
process.env = newEnv;
// Return a function that restores the original environment.
return ()=>{
process.env = oldEnv;
};
}
//# sourceMappingURL=env.js.map