Skip to content

Commit

Permalink
feat: Stabilize Deno.osRelease() API (denoland#15973)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju authored Oct 26, 2022
1 parent 851db03 commit 046ab7d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
16 changes: 16 additions & 0 deletions cli/dts/lib.deno.ns.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,22 @@ declare namespace Deno {
*/
export const noColor: boolean;

/**
* Returns the release version of the Operating System.
*
* ```ts
* console.log(Deno.osRelease());
* ```
*
* Requires `allow-env` permission.
* Under consideration to possibly move to Deno.build or Deno.versions and if
* it should depend sys-info, which may not be desirable.
*
* @tags allow-env
* @category Runtime Environment
*/
export function osRelease(): string;

/**
* Options which define the permissions within a test or worker context.
*
Expand Down
17 changes: 0 additions & 17 deletions cli/dts/lib.deno.unstable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,23 +226,6 @@ declare namespace Deno {
*/
export function umask(mask?: number): number;

/** **UNSTABLE**: New API, yet to be vetted.
*
* Returns the release version of the Operating System.
*
* ```ts
* console.log(Deno.osRelease());
* ```
*
* Requires `allow-sys` permission.
* Under consideration to possibly move to Deno.build or Deno.versions and if
* it should depend sys-info, which may not be desirable.
*
* @tags allow-sys
* @category Runtime Environment
*/
export function osRelease(): string;

/** **UNSTABLE**: New API, yet to be vetted.
*
* Displays the total amount of free and used physical and swap memory in the
Expand Down
1 change: 0 additions & 1 deletion runtime/ops/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ fn op_hostname(state: &mut OpState) -> Result<String, AnyError> {

#[op]
fn op_os_release(state: &mut OpState) -> Result<String, AnyError> {
super::check_unstable(state, "Deno.osRelease");
state
.borrow_mut::<Permissions>()
.sys
Expand Down

0 comments on commit 046ab7d

Please sign in to comment.