Skip to content

Commit c1ef7ed

Browse files
committed
refactor: fix type annotations in open
There was no clear reason as to why we needed to use type assertions when initializing both `args` and `options` in `open` so I refactored them both.
1 parent 2c1cf02 commit c1ef7ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node/util.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,8 @@ export const open = async (address: URL | string): Promise<void> => {
416416
if (url.hostname === "0.0.0.0") {
417417
url.hostname = "localhost"
418418
}
419-
const args = [] as string[]
420-
const options = {} as cp.SpawnOptions
419+
const args: string[] = []
420+
const options: cp.SpawnOptions = {}
421421
const platform = (await isWsl(process.platform, os.release(), "/proc/version")) ? "wsl" : process.platform
422422
let command = platform === "darwin" ? "open" : "xdg-open"
423423
if (platform === "win32" || platform === "wsl") {

0 commit comments

Comments
 (0)