Skip to content

Commit

Permalink
Add pid
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed Apr 24, 2024
1 parent 725c8b6 commit 0cef796
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions utils/pid.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { test } from "@cross/test";
import { assertTrue } from "@std/assert";
import { assertEquals } from "@std/assert";

import { pid } from "./pid.ts";

test("Aliases don't override original arguments", () => {
assertTrue(pid() > 0);
assertEquals(pid() > 0, true);
});
2 changes: 1 addition & 1 deletion utils/pid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { CurrentRuntime, Runtime } from "@cross/runtime";
export function pid(): number {
if (CurrentRuntime === Runtime.Deno) {
//@ts-ignore cross-runtime
return crossPid();
return Deno.pid;
} else {
//@ts-ignore cross-runtime
return process.pid;
Expand Down

0 comments on commit 0cef796

Please sign in to comment.