Last 12 weeks · 0 commits
4 of 6 standards met
Added edge cases for the script in cases if the user is not on Linux, or if using XWayland, and make if the script is unsure returns false as to not break app that require Wayland only API calls. Github Copilot Summary: This pull request significantly refactors and extends the Wayland detection logic in . The main change is the introduction of a new, more robust function, which allows for easier testing and greater flexibility by accepting environment and platform parameters. The default export now delegates to this function, and basic sanity tests are included for verification. Wayland detection improvements: Introduced a new function that checks multiple environment variables and runtime indicators to determine if the current session is running under Wayland, making detection more robust and testable. Enhanced detection logic to consider additional environment variables (, , , ), the contents of the directory, and to exclude WSL environments. Testing and flexibility: Added inline sanity tests using Node's module, which run when the script is executed directly, ensuring correctness of the detection logic. Refactored the default export to use the new detection function and support custom file system and environment accessors, improving testability and modularity. Compatibility improvements:**
Repository: sindresorhus/is-wayland. Description: Check if the current Linux session is using Wayland Stars: 21, Forks: 2. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Latest release: v0.1.0 (11mo ago). Open PRs: 0, open issues: 0. Last activity: 11mo ago. Community health: 71%. Top contributors: sindresorhus.