Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit f13aec4

Browse files
authored
Merge pull request #194 from exoego/cleanup-nodejs-v8
[os][stream] Refine return types after dropping Node.js v8
2 parents 3c2e0d0 + 9c3e1b9 commit f13aec4

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

app/current/src/main/scala/io/scalajs/nodejs/os/OS.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ trait OS extends js.Object {
133133
* Returns the system uptime in seconds.
134134
* @example os.uptime()
135135
*/
136-
// TODO: Return type should be Int after dropping Node.js 8 (Windows returns decimal until Node.js 10))
137-
def uptime(): Double = js.native
136+
def uptime(): Int = js.native
138137

139138
/**
140139
* The os.userInfo() method returns information about the currently effective user -- on POSIX platforms,

app/current/src/main/scala/io/scalajs/nodejs/stream/Stream.scala

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,12 @@ sealed trait IWritable extends LegacyStream {
267267

268268
def destroyed: Boolean = js.native
269269

270-
// TODO: Return type should be this.type if node.js v8 dropped
271-
def end(chunk: String | Uint8Array, callback: js.Function1[Error, Any]): js.UndefOr[this.type] = js.native
272-
def end(chunk: String | Uint8Array): js.UndefOr[this.type] = js.native
270+
def end(chunk: String | Uint8Array, callback: js.Function1[Error, Any]): this.type = js.native
271+
def end(chunk: String | Uint8Array): js.UndefOr[this.type] = js.native
273272

274-
def end(chunk: String, encoding: String, callback: js.Function1[Error, Any]): js.UndefOr[this.type] = js.native
275-
def end(chunk: String, encoding: String): js.UndefOr[this.type] = js.native
276-
def end(callback: js.Function1[Error, Any] = js.native): js.UndefOr[this.type] = js.native
273+
def end(chunk: String, encoding: String, callback: js.Function1[Error, Any]): this.type = js.native
274+
def end(chunk: String, encoding: String): this.type = js.native
275+
def end(callback: js.Function1[Error, Any] = js.native): this.type = js.native
277276

278277
/**
279278
* Sets the default encoding for a writable stream.

0 commit comments

Comments
 (0)