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:
parent
70bc0eb72b
commit
b8e3f4c71d
4 changed files with 14 additions and 19 deletions
|
@ -40,7 +40,6 @@ const UNSTABLE_DENO_PROPS: &[&str] = &[
|
|||
"createHttpClient",
|
||||
"futime",
|
||||
"futimeSync",
|
||||
"hostname",
|
||||
"kill",
|
||||
"listen",
|
||||
"listenDatagram",
|
||||
|
|
14
cli/dts/lib.deno.ns.d.ts
vendored
14
cli/dts/lib.deno.ns.d.ts
vendored
|
@ -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/
|
||||
|
|
17
cli/dts/lib.deno.unstable.d.ts
vendored
17
cli/dts/lib.deno.unstable.d.ts
vendored
|
@ -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`.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue