* Checks if the system is using MUSL libc instead of glibc. * In native linux builds, this is statically known at compile time via IS_LIBC_MUSL/IS_LIBC_GLIBC flags. * In node (unbundled), both flags are false and we fall back to a runtime async stat check * whose result is cached at module load.
()
| 52 | * whose result is cached at module load. If the cache isn't populated yet, returns false. |
| 53 | */ |
| 54 | function isMuslEnvironment(): boolean { |
| 55 | if (feature('IS_LIBC_MUSL')) return true |
| 56 | if (feature('IS_LIBC_GLIBC')) return false |
| 57 | |
| 58 | // Fallback for node: runtime detection via pre-populated cache |
| 59 | if (process.platform !== 'linux') return false |
| 60 | return muslRuntimeCache ?? false |
| 61 | } |
| 62 | |
| 63 | // Cache for async JetBrains detection |
| 64 | let jetBrainsIDECache: string | null | undefined |
nothing calls this directly
no outgoing calls
no test coverage detected