mirror of
https://github.com/denoland/deno
synced 2024-08-24 18:47:06 +00:00
fix(ext/node): support delete process.env.var (#23647)
Closes https://github.com/denoland/deno/issues/23641
This commit is contained in:
parent
66b66de96a
commit
56ba7f3c23
|
@ -88,6 +88,10 @@ export const env: InstanceType<ObjectConstructor> & Record<string, string> =
|
|||
return true; // success
|
||||
},
|
||||
has: (_target, prop) => typeof denoEnvGet(String(prop)) === "string",
|
||||
deleteProperty(_target, key) {
|
||||
Deno.env.delete(String(key));
|
||||
return true;
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
@ -416,6 +416,9 @@ Deno.test({
|
|||
assertEquals(process.env.HELLO, "false");
|
||||
process.env.HELLO = "WORLD";
|
||||
assertEquals(process.env.HELLO, "WORLD");
|
||||
|
||||
delete process.env.HELLO;
|
||||
assertEquals(process.env.HELLO, undefined);
|
||||
},
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue