mirror of
https://github.com/denoland/deno.git
synced 2024-10-29 08:58:01 -04:00
docs: env.get will return undefined
if not exist (#10514)
This commit is contained in:
parent
a9c58d5e51
commit
7e22987876
1 changed files with 3 additions and 3 deletions
6
cli/dts/lib.deno.ns.d.ts
vendored
6
cli/dts/lib.deno.ns.d.ts
vendored
|
@ -177,12 +177,12 @@ declare namespace Deno {
|
|||
export function exit(code?: number): never;
|
||||
|
||||
export const env: {
|
||||
/** Retrieve the value of an environment variable. Returns undefined if that
|
||||
/** Retrieve the value of an environment variable. Returns `undefined` if that
|
||||
* key doesn't exist.
|
||||
*
|
||||
* ```ts
|
||||
* console.log(Deno.env.get("HOME")); // e.g. outputs "/home/alice"
|
||||
* console.log(Deno.env.get("MADE_UP_VAR")); // outputs "Undefined"
|
||||
* console.log(Deno.env.get("MADE_UP_VAR")); // outputs "undefined"
|
||||
* ```
|
||||
* Requires `allow-env` permission. */
|
||||
get(key: string): string | undefined;
|
||||
|
@ -201,7 +201,7 @@ declare namespace Deno {
|
|||
*
|
||||
* ```ts
|
||||
* Deno.env.set("SOME_VAR", "Value");
|
||||
* Deno.env.delete("SOME_VAR"); // outputs "Undefined"
|
||||
* Deno.env.delete("SOME_VAR"); // outputs "undefined"
|
||||
* ```
|
||||
*
|
||||
* Requires `allow-env` permission. */
|
||||
|
|
Loading…
Reference in a new issue