Skip to content

Commit 3820ed3

Browse files
committed
fix: typing errors
1 parent cb9d278 commit 3820ed3

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/internal/binary/resolve-binary.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { existsSync } from "node:fs";
22
import { join } from "node:path";
3-
import type { Platform } from "node:process";
43
import { fileURLToPath, pathToFileURL } from "node:url";
54

65
declare const __dirname: string | undefined;
@@ -55,7 +54,7 @@ function resolvePackageRoot(
5554
const PACKAGE_ROOT = resolvePackageRoot(moduleUrl, __dirname);
5655
const CUSTOM_BINARY_ENV = "LAME_BINARY";
5756

58-
function getPlatformExecutableSuffix(platform: Platform): string {
57+
function getPlatformExecutableSuffix(platform: typeof process.platform): string {
5958
return platform === "win32" ? ".exe" : "";
6059
}
6160

tests/unit/resolve-binary.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { mkdir, rm, writeFile } from "node:fs/promises";
22
import { join, resolve as resolvePath } from "node:path";
3-
import type { Platform } from "node:process";
43
import { tmpdir } from "node:os";
54
import { pathToFileURL } from "node:url";
65
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
@@ -84,7 +83,7 @@ describe("resolve-binary", () => {
8483
const fallback = deriveModuleUrl(undefined, "/tmp/example.js");
8584
expect(fallback).toBe(pathToFileURL("/tmp/example.js").href);
8685
expect(getPlatformExecutableSuffix("win32")).toBe(".exe");
87-
expect(getPlatformExecutableSuffix("linux" as Platform)).toBe("");
86+
expect(getPlatformExecutableSuffix("linux" as typeof process.platform)).toBe("");
8887
expect(deriveModuleUrl(undefined, undefined)).toBeUndefined();
8988
expect(deriveModuleUrl({ url: 123 } as unknown as { url?: string }, "/tmp/fallback.js")).toBe(
9089
pathToFileURL("/tmp/fallback.js").href,

0 commit comments

Comments
 (0)