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 5
5
6
6
package kotlinx.io.node
7
7
8
- import kotlinx.io.withCaughtException
9
-
10
8
internal external interface BufferModule {
11
9
val Buffer : BufferObj
12
10
}
@@ -28,4 +26,4 @@ internal val buffer: BufferModule by lazy {
28
26
loadModule(" buffer" , ::bufferInitializer)
29
27
}
30
28
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 {
90
90
loadModule(" fs" , ::fsInitializer)
91
91
}
92
92
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 {
22
22
loadModule(" os" , ::osInitializer)
23
23
}
24
24
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 {
18
18
loadModule(" path" , ::pathInitializer)
19
19
}
20
20
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