From 1fff6f55c3ba98a10018c6d374795e612061e9b6 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Fri, 12 Jun 2020 20:23:38 +0100 Subject: refactor: Don't destructure the Deno namespace (#6268) --- std/node/process.ts | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'std/node/process.ts') diff --git a/std/node/process.ts b/std/node/process.ts index 9da41b45b..cad72a00a 100644 --- a/std/node/process.ts +++ b/std/node/process.ts @@ -1,32 +1,22 @@ import { notImplemented } from "./_utils.ts"; -const version = `v${Deno.version.deno}`; - -const versions = { - node: Deno.version.deno, - ...Deno.version, -}; - -const platform = Deno.build.os === "windows" ? "win32" : Deno.build.os; - -const { arch } = Deno.build; - -const { pid, cwd, chdir, exit } = Deno; - function on(_event: string, _callback: Function): void { // TODO(rsp): to be implemented notImplemented(); } export const process = { - version, - versions, - platform, - arch, - pid, - cwd, - chdir, - exit, + version: `v${Deno.version.deno}`, + versions: { + node: Deno.version.deno, + ...Deno.version, + }, + platform: Deno.build.os === "windows" ? "win32" : Deno.build.os, + arch: Deno.build.arch, + pid: Deno.pid, + cwd: Deno.cwd, + chdir: Deno.chdir, + exit: Deno.exit, on, get env(): { [index: string]: string } { // using getter to avoid --allow-env unless it's used -- cgit v1.2.3