1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

feat: Stabilize Deno.hostname() API (#15932)

This commit is contained in:
Bartek Iwańczuk 2022-09-28 15:36:06 +02:00 committed by GitHub
parent 70bc0eb72b
commit b8e3f4c71d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 19 deletions

View file

@ -40,7 +40,6 @@ const UNSTABLE_DENO_PROPS: &[&str] = &[
"createHttpClient",
"futime",
"futimeSync",
"hostname",
"kill",
"listen",
"listenDatagram",

View file

@ -161,6 +161,20 @@ declare namespace Deno {
*/
export function memoryUsage(): MemoryUsage;
/**
* Get the `hostname` of the machine the Deno process is running on.
*
* ```ts
* console.log(Deno.hostname());
* ```
*
* Requires `allow-sys` permission.
*
* @tags allow-sys
* @category Runtime Environment
*/
export function hostname(): string;
/** Reflects the `NO_COLOR` environment variable at program start.
*
* See: https://no-color.org/

View file

@ -940,23 +940,6 @@ declare namespace Deno {
},
>(opt: T): Process<T>;
/** **UNSTABLE**: New API, yet to be vetted.
*
* Get the `hostname` of the machine the Deno process is running on.
*
* ```ts
* console.log(Deno.hostname());
* ```
*
* Requires `allow-sys` permission.
* Additional consideration is still necessary around the permissions
* required.
*
* @tags allow-sys
* @category Runtime Environment
*/
export function hostname(): string;
/** **UNSTABLE**: New API, yet to be vetted.
*
* A custom HttpClient for use with `fetch`.

View file

@ -173,7 +173,6 @@ fn op_loadavg(state: &mut OpState) -> Result<(f64, f64, f64), AnyError> {
#[op]
fn op_hostname(state: &mut OpState) -> Result<String, AnyError> {
super::check_unstable(state, "Deno.hostname");
state
.borrow_mut::<Permissions>()
.sys