sindresorhus / open

Open stuff like URLs, files, executables. Cross-platform.
MIT License
3.18k stars 219 forks source link

fix: update `openApp(app)` to not error when `app` is an array #335

Closed raymondji closed 7 months ago

raymondji commented 7 months ago

openApp(apps.chrome) is one of the examples in the documentation:

// Open an app with arguments.
await openApp(apps.chrome, {arguments: ['--incognito']});

However this fails on WSL because openApp asserts that the app arguement is a string, but apps.chrome is an array of strings.

This PR fixes the issue by allowing arrays as well in the type check.

Repro steps:

Expected result:

Got result:

Testing done: