File tree Expand file tree Collapse file tree 6 files changed +26
-6
lines changed
nodeFilesystemShared/src/node Expand file tree Collapse file tree 6 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
3+ * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
4+ */
5+
6+ package kotlinx.io.node
7+
8+ internal actual fun bufferInitializer (): BufferModule ? = js(" eval('require')('buffer')" )
9+ internal actual fun osInitializer (): Os ? = js(" eval('require')('os')" )
10+ internal actual fun fsInitializer (): Fs ? = js(" eval('require')('fs')" )
11+ internal actual fun pathInitializer (): Path ? = js(" eval('require')('path')" )
Original file line number Diff line number Diff line change 55
66package kotlinx.io.node
77
8- import kotlinx.io.withCaughtException
9-
108internal external interface BufferModule {
119 val Buffer : BufferObj
1210}
@@ -28,4 +26,4 @@ internal val buffer: BufferModule by lazy {
2826 loadModule(" buffer" , ::bufferInitializer)
2927}
3028
31- private fun bufferInitializer (): BufferModule ? = js( " eval('require')('buffer') " )
29+ internal expect fun bufferInitializer (): BufferModule ?
Original file line number Diff line number Diff line change @@ -90,4 +90,4 @@ internal val fs: Fs by lazy {
9090 loadModule(" fs" , ::fsInitializer)
9191}
9292
93- private fun fsInitializer (): Fs ? = js( " eval('require')('fs') " )
93+ internal expect fun fsInitializer (): Fs ?
Original file line number Diff line number Diff line change @@ -22,4 +22,4 @@ internal val os: Os by lazy {
2222 loadModule(" os" , ::osInitializer)
2323}
2424
25- private fun osInitializer (): Os ? = js( " eval('require')('os') " )
25+ internal expect fun osInitializer (): Os ?
Original file line number Diff line number Diff line change @@ -18,4 +18,4 @@ internal val path: Path by lazy {
1818 loadModule(" path" , ::pathInitializer)
1919}
2020
21- private fun pathInitializer (): Path ? = js( " eval('require')('path') " )
21+ internal expect fun pathInitializer (): Path ?
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
3+ * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
4+ */
5+
6+ package kotlinx.io.node
7+
8+ internal actual fun bufferInitializer (): BufferModule ? = js(" eval('require')('buffer')" )
9+ internal actual fun osInitializer (): Os ? = js(" eval('require')('os')" )
10+ internal actual fun fsInitializer (): Fs ? = js(" eval('require')('fs')" )
11+ internal actual fun pathInitializer (): Path ? = js(" eval('require')('path')" )
You can’t perform that action at this time.
0 commit comments