summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2018-10-04 21:20:14 +1000
committerRyan Dahl <ry@tinyclouds.org>2018-10-04 12:31:39 -0400
commitce9148943c4ffa43252e3692014489ebcff3d51e (patch)
tree07510ec5cc8ba385c137baaeeb3dff3192c68ce6 /js
parent5307aa94e14d99a226366a275e011a60161c9c39 (diff)
Move Platform from types to platform
Diffstat (limited to 'js')
-rw-r--r--js/platform.ts21
-rw-r--r--js/read_link_test.ts4
-rw-r--r--js/types.ts6
3 files changed, 21 insertions, 10 deletions
diff --git a/js/platform.ts b/js/platform.ts
index 704ed0743..d1732f73f 100644
--- a/js/platform.ts
+++ b/js/platform.ts
@@ -1,3 +1,20 @@
-import { Platform } from "./types";
+// Do not add unsupported platforms.
+export interface Platform {
+ /**
+ * The operating system CPU architecture
+ */
+ arch: "x64";
+
+ /**
+ * The operating system platform
+ */
+ os: "mac" | "win" | "linux";
+}
+
// 'platform' is injected by rollup.config.js at compile time.
-export const platform: Platform = {};
+export const platform: Platform = {
+ // tslint:disable:no-any
+ arch: "" as any,
+ os: "" as any
+ // tslint:disable:any
+};
diff --git a/js/read_link_test.ts b/js/read_link_test.ts
index 2df6b30d0..583847654 100644
--- a/js/read_link_test.ts
+++ b/js/read_link_test.ts
@@ -9,7 +9,7 @@ testPerm({ write: true }, function readlinkSyncSuccess() {
deno.mkdirSync(target);
// TODO Add test for Windows once symlink is implemented for Windows.
// See https://github.com/denoland/deno/issues/815.
- if (deno.platform !== "win32") {
+ if (deno.platform.os !== "win") {
deno.symlinkSync(target, symlink);
const targetPath = deno.readlinkSync(symlink);
assertEqual(targetPath, target);
@@ -36,7 +36,7 @@ testPerm({ write: true }, async function readlinkSuccess() {
deno.mkdirSync(target);
// TODO Add test for Windows once symlink is implemented for Windows.
// See https://github.com/denoland/deno/issues/815.
- if (deno.platform !== "win32") {
+ if (deno.platform.os !== "win") {
deno.symlinkSync(target, symlink);
const targetPath = await deno.readlink(symlink);
assertEqual(targetPath, target);
diff --git a/js/types.ts b/js/types.ts
index 3ef8f81e5..7af0a5201 100644
--- a/js/types.ts
+++ b/js/types.ts
@@ -151,9 +151,3 @@ declare global {
stackTraceLimit: number;
}
}
-
-// Do not add unsupported platforms.
-export interface Platform {
- arch?: "x64";
- os?: "mac" | "win" | "linux";
-}