andreasmattsson
12/14/2017, 5:59 PM*-common-js
gradle subproject that gets imported in a version of the app that I would like to be able to run both headlessly (e.g. with node) or in a browser.
I thought perhaps I could check if kotlin.browser.window
and compare it with either null
or kotlin.js.undefined
, however both these give me ReferenceError: window is not defined
andreasmattsson
12/14/2017, 6:16 PMprivate val hasDom = eval("typeof window").toString() != "undefined"
konsoletyper
12/15/2017, 8:52 AMprivate val hasDom: Boolean get() = jsTypeOf(window) != "undefined"