safelyAccessDocument

fun safelyAccessDocument(_document: Any?): Any?

Returns _document when it is truthy, otherwise null. Mirrors the JavaScript helper that would fall back to the global document binding; commonMain has no such global, so the fallback always yields null.