mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05: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
2 changed files with 7 additions and 0 deletions
|
@ -88,6 +88,10 @@ export const env: InstanceType<ObjectConstructor> & Record<string, string> =
|
||||||
return true; // success
|
return true; // success
|
||||||
},
|
},
|
||||||
has: (_target, prop) => typeof denoEnvGet(String(prop)) === "string",
|
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");
|
assertEquals(process.env.HELLO, "false");
|
||||||
process.env.HELLO = "WORLD";
|
process.env.HELLO = "WORLD";
|
||||||
assertEquals(process.env.HELLO, "WORLD");
|
assertEquals(process.env.HELLO, "WORLD");
|
||||||
|
|
||||||
|
delete process.env.HELLO;
|
||||||
|
assertEquals(process.env.HELLO, undefined);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue