From 3944aebdc46b13ca57902f497b6fd490a90ef540 Mon Sep 17 00:00:00 2001 From: TATSUNO Yasuhiro Date: Wed, 7 Oct 2020 10:37:59 +0900 Subject: [PATCH] Update scalafmt to 2.7.4 --- .scalafmt.conf | 2 +- .../scala/io/scalajs/nodejs/AssertTest.scala | 3 +- .../child_process/ChildProcessTest.scala | 3 +- .../io/scalajs/nodejs/dns/DNSAsyncTest.scala | 3 +- .../scala/io/scalajs/nodejs/fs/FsTest.scala | 3 +- .../io/scalajs/nodejs/http/HttpTest.scala | 3 +- .../scalajs/nodejs/http/StatusCodeTest.scala | 3 +- .../scala/io/scalajs/nodejs/net/NetTest.scala | 3 +- .../scala/io/scalajs/nodejs/os/OSTest.scala | 3 +- .../nodejs/querystring/QueryStringTest.scala | 6 +- .../nodejs/readline/ReadlineTest.scala | 3 +- .../scala/io/scalajs/nodejs/tty/TTYTest.scala | 3 +- .../io/scalajs/nodejs/url/URLObjectTest.scala | 3 +- .../scala/io/scalajs/nodejs/vm/VMTest.scala | 9 +- .../io/scalajs/nodejs/buffer/BufferTest.scala | 3 +- .../io/scalajs/nodejs/fs/FsClassesTest.scala | 3 +- .../main/scala/io/scalajs/nodejs/Assert.scala | 39 +-- .../main/scala/io/scalajs/nodejs/Error.scala | 21 +- .../main/scala/io/scalajs/nodejs/Module.scala | 24 +- .../io/scalajs/nodejs/StringDecoder.scala | 9 +- .../scala/io/scalajs/nodejs/SystemError.scala | 18 +- .../io/scalajs/nodejs/buffer/Buffer.scala | 216 +++++-------- .../io/scalajs/nodejs/buffer/package.scala | 30 +- .../nodejs/child_process/ChildProcess.scala | 6 +- .../child_process/ExecFileSyncOptions.scala | 3 +- .../nodejs/child_process/ExecOptions.scala | 3 +- .../child_process/SpawnSyncOptions.scala | 3 +- .../io/scalajs/nodejs/cluster/Address.scala | 3 +- .../io/scalajs/nodejs/cluster/Cluster.scala | 33 +- .../nodejs/cluster/ClusterSettings.scala | 6 +- .../io/scalajs/nodejs/cluster/Worker.scala | 27 +- .../io/scalajs/nodejs/cluster/package.scala | 51 +-- .../nodejs/console_module/Console.scala | 75 ++--- .../io/scalajs/nodejs/crypto/Cipher.scala | 21 +- .../io/scalajs/nodejs/crypto/Crypto.scala | 36 +-- .../io/scalajs/nodejs/crypto/Decipher.scala | 21 +- .../scala/io/scalajs/nodejs/crypto/Hash.scala | 18 +- .../scala/io/scalajs/nodejs/crypto/Hmac.scala | 18 +- .../io/scalajs/nodejs/crypto/KeyObject.scala | 9 +- .../scala/io/scalajs/nodejs/crypto/Sign.scala | 3 +- .../io/scalajs/nodejs/crypto/Verify.scala | 9 +- .../io/scalajs/nodejs/dgram/Socket.scala | 18 +- .../scala/io/scalajs/nodejs/dns/DNS.scala | 15 +- .../scala/io/scalajs/nodejs/dns/package.scala | 18 +- .../scalajs/nodejs/events/EventEmitter.scala | 42 +-- .../io/scalajs/nodejs/fs/FSConstants.scala | 87 ++---- .../io/scalajs/nodejs/fs/FSWatcher.scala | 9 +- .../main/scala/io/scalajs/nodejs/fs/Fs.scala | 294 ++++++------------ .../io/scalajs/nodejs/fs/ReadStream.scala | 12 +- .../scala/io/scalajs/nodejs/fs/Stats.scala | 21 +- .../io/scalajs/nodejs/fs/WriteStream.scala | 12 +- .../scala/io/scalajs/nodejs/fs/package.scala | 42 +-- .../scala/io/scalajs/nodejs/http/Agent.scala | 24 +- .../scala/io/scalajs/nodejs/http/Client.scala | 15 +- .../scalajs/nodejs/http/ClientRequest.scala | 21 +- .../scala/io/scalajs/nodejs/http/Http.scala | 15 +- .../scalajs/nodejs/http/IncomingMessage.scala | 33 +- .../scalajs/nodejs/http/OutgoingMessage.scala | 3 +- .../scala/io/scalajs/nodejs/http/Server.scala | 3 +- .../scalajs/nodejs/http/ServerResponse.scala | 39 +-- .../io/scalajs/nodejs/http/package.scala | 72 ++--- .../nodejs/http2/Http2ServerRequest.scala | 3 +- .../scala/io/scalajs/nodejs/https/Agent.scala | 3 +- .../scala/io/scalajs/nodejs/https/Https.scala | 12 +- .../io/scalajs/nodejs/https/Server.scala | 3 +- .../io/scalajs/nodejs/https/package.scala | 15 +- .../scala/io/scalajs/nodejs/net/Address.scala | 3 +- .../scala/io/scalajs/nodejs/net/Net.scala | 21 +- .../scala/io/scalajs/nodejs/net/Server.scala | 27 +- .../scala/io/scalajs/nodejs/net/Socket.scala | 51 +-- .../scala/io/scalajs/nodejs/net/package.scala | 51 +-- .../scalajs/nodejs/os/NetworkInterface.scala | 3 +- .../main/scala/io/scalajs/nodejs/os/OS.scala | 60 ++-- .../io/scalajs/nodejs/os/UserInfoObject.scala | 3 +- .../scala/io/scalajs/nodejs/package.scala | 12 +- .../scala/io/scalajs/nodejs/path/Path.scala | 48 +-- .../io/scalajs/nodejs/process/Process.scala | 141 +++------ .../io/scalajs/nodejs/process/package.scala | 33 +- .../io/scalajs/nodejs/punycode/Punycode.scala | 30 +- .../nodejs/querystring/QueryString.scala | 18 +- .../scalajs/nodejs/querystring/package.scala | 6 +- .../scalajs/nodejs/readline/Interface.scala | 30 +- .../io/scalajs/nodejs/readline/Readline.scala | 21 +- .../io/scalajs/nodejs/readline/package.scala | 21 +- .../scala/io/scalajs/nodejs/repl/REPL.scala | 6 +- .../io/scalajs/nodejs/repl/REPLServer.scala | 15 +- .../io/scalajs/nodejs/repl/package.scala | 24 +- .../io/scalajs/nodejs/stream/Stream.scala | 69 ++-- .../io/scalajs/nodejs/stream/package.scala | 33 +- .../nodejs/timers/ClearImmediate.scala | 6 +- .../scalajs/nodejs/timers/ClearInterval.scala | 6 +- .../scalajs/nodejs/timers/ClearTimeout.scala | 6 +- .../io/scalajs/nodejs/timers/Immediate.scala | 3 +- .../io/scalajs/nodejs/timers/Interval.scala | 6 +- .../scala/io/scalajs/nodejs/timers/Ref.scala | 6 +- .../scalajs/nodejs/timers/SetImmediate.scala | 6 +- .../scalajs/nodejs/timers/SetInterval.scala | 6 +- .../io/scalajs/nodejs/timers/SetTimeout.scala | 6 +- .../io/scalajs/nodejs/timers/Timeout.scala | 6 +- .../io/scalajs/nodejs/timers/Timer.scala | 3 +- .../io/scalajs/nodejs/timers/UnRef.scala | 6 +- .../scala/io/scalajs/nodejs/tls/Server.scala | 12 +- .../scalajs/nodejs/tls/TLSCertificate.scala | 3 +- .../io/scalajs/nodejs/tls/TLSSocket.scala | 12 +- .../scala/io/scalajs/nodejs/tls/Tls.scala | 6 +- .../io/scalajs/nodejs/tty/ReadStream.scala | 12 +- .../scala/io/scalajs/nodejs/tty/TTY.scala | 9 +- .../io/scalajs/nodejs/tty/WriteStream.scala | 12 +- .../scala/io/scalajs/nodejs/tty/package.scala | 9 +- .../scala/io/scalajs/nodejs/url/URL.scala | 63 ++-- .../io/scalajs/nodejs/url/URLObject.scala | 39 +-- .../scalajs/nodejs/url/URLSearchParams.scala | 45 +-- .../scala/io/scalajs/nodejs/util/Util.scala | 18 +- .../scala/io/scalajs/nodejs/vm/Script.scala | 12 +- .../main/scala/io/scalajs/nodejs/vm/VM.scala | 21 +- .../scalajs/nodejs/zlib/BrotliCompress.scala | 3 +- .../nodejs/zlib/BrotliDecompress.scala | 3 +- .../nodejs/zlib/CompressionOptions.scala | 3 +- .../io/scalajs/nodejs/zlib/Deflate.scala | 3 +- .../io/scalajs/nodejs/zlib/DeflateRaw.scala | 3 +- .../scala/io/scalajs/nodejs/zlib/Gunzip.scala | 3 +- .../scala/io/scalajs/nodejs/zlib/Gzip.scala | 3 +- .../io/scalajs/nodejs/zlib/Inflate.scala | 3 +- .../io/scalajs/nodejs/zlib/InflateRaw.scala | 3 +- .../scala/io/scalajs/nodejs/zlib/Unzip.scala | 3 +- .../scala/io/scalajs/nodejs/zlib/Zlib.scala | 66 ++-- .../io/scalajs/nodejs/zlib/ZlibBase.scala | 3 +- .../io/scalajs/nodejs/zlib/package.scala | 6 +- .../scala/io/scalajs/util/PromiseHelper.scala | 54 ++-- 129 files changed, 938 insertions(+), 1875 deletions(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index f4e2613c5..a3035aae3 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "2.7.3" +version = "2.7.4" style = defaultWithAlign maxColumn = 120 align.openParenDefnSite = true diff --git a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/AssertTest.scala b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/AssertTest.scala index 2fd2488fa..b2b224d8e 100644 --- a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/AssertTest.scala +++ b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/AssertTest.scala @@ -3,8 +3,7 @@ package io.scalajs.nodejs import scala.scalajs.js import org.scalatest.funspec.AnyFunSpec -/** - * Assert Test +/** Assert Test */ class AssertTest extends AnyFunSpec { describe("Assert") { diff --git a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/child_process/ChildProcessTest.scala b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/child_process/ChildProcessTest.scala index c3a25838c..9692bfa9a 100644 --- a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/child_process/ChildProcessTest.scala +++ b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/child_process/ChildProcessTest.scala @@ -9,8 +9,7 @@ import scala.scalajs.js import scala.scalajs.js.| import org.scalatest.funspec.AsyncFunSpec -/** - * ChildProcess Test +/** ChildProcess Test */ class ChildProcessTest extends AsyncFunSpec { override implicit val executionContext = ExecutionContext.Implicits.global diff --git a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/dns/DNSAsyncTest.scala b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/dns/DNSAsyncTest.scala index 5c421dd85..b290db30c 100644 --- a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/dns/DNSAsyncTest.scala +++ b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/dns/DNSAsyncTest.scala @@ -5,8 +5,7 @@ import scala.concurrent.{ExecutionContext, Promise} import scala.scalajs.js import org.scalatest.funspec.AsyncFunSpec -/** - * DNS Tests +/** DNS Tests */ class DNSAsyncTest extends AsyncFunSpec { private val domain = "google.com" diff --git a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/fs/FsTest.scala b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/fs/FsTest.scala index 6ae7e2d81..4ca1db9cf 100644 --- a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/fs/FsTest.scala +++ b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/fs/FsTest.scala @@ -6,8 +6,7 @@ import io.scalajs.nodejs.TestHelper._ import scala.concurrent.{ExecutionContext, Promise} import org.scalatest.funspec.AsyncFunSpec -/** - * File System (Fs) Tests +/** File System (Fs) Tests */ class FsTest extends AsyncFunSpec { override implicit val executionContext = ExecutionContext.Implicits.global diff --git a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/http/HttpTest.scala b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/http/HttpTest.scala index 282e93e50..405a7e660 100644 --- a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/http/HttpTest.scala +++ b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/http/HttpTest.scala @@ -4,8 +4,7 @@ package http import scala.scalajs.js import org.scalatest.funspec.AnyFunSpec -/** - * Http Tests +/** Http Tests */ class HttpTest extends AnyFunSpec { describe("Http") { diff --git a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/http/StatusCodeTest.scala b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/http/StatusCodeTest.scala index cac0a741a..622c51149 100644 --- a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/http/StatusCodeTest.scala +++ b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/http/StatusCodeTest.scala @@ -3,8 +3,7 @@ package io.scalajs.nodejs.http import scala.scalajs.js import org.scalatest.funspec.AnyFunSpec -/** - * Http Tests +/** Http Tests */ class StatusCodeTest extends AnyFunSpec { describe("Http") { diff --git a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/net/NetTest.scala b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/net/NetTest.scala index ef06115e8..247f8d65a 100644 --- a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/net/NetTest.scala +++ b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/net/NetTest.scala @@ -2,8 +2,7 @@ package io.scalajs.nodejs.net import org.scalatest.funspec.AnyFunSpec -/** - * Network (Net) Tests +/** Network (Net) Tests */ class NetTest extends AnyFunSpec { describe("Net") { diff --git a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/os/OSTest.scala b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/os/OSTest.scala index a33dcd93e..e787c51b0 100644 --- a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/os/OSTest.scala +++ b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/os/OSTest.scala @@ -3,8 +3,7 @@ package io.scalajs.nodejs.os import io.scalajs.nodejs.TestHelper._ import org.scalatest.funspec.AnyFunSpec -/** - * OS Tests +/** OS Tests */ class OSTest extends AnyFunSpec { describe("OS") { diff --git a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/querystring/QueryStringTest.scala b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/querystring/QueryStringTest.scala index e8e2d5f3a..aebecd7bc 100644 --- a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/querystring/QueryStringTest.scala +++ b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/querystring/QueryStringTest.scala @@ -5,8 +5,7 @@ import io.scalajs.nodejs.querystring.QueryStringTest.MyParams import scala.scalajs.js import org.scalatest.funspec.AnyFunSpec -/** - * Query String Test +/** Query String Test */ class QueryStringTest extends AnyFunSpec { describe("QueryString") { @@ -41,8 +40,7 @@ class QueryStringTest extends AnyFunSpec { } } -/** - * Query String Test Companion +/** Query String Test Companion */ object QueryStringTest { class MyParams(val foo: String, val bar: String) extends js.Object diff --git a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/readline/ReadlineTest.scala b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/readline/ReadlineTest.scala index 28f6dae27..84e90a50e 100644 --- a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/readline/ReadlineTest.scala +++ b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/readline/ReadlineTest.scala @@ -6,8 +6,7 @@ import io.scalajs.nodejs.process.Process import scala.concurrent.{ExecutionContext, Promise} import org.scalatest.funspec.AsyncFunSpec -/** - * Readline Tests +/** Readline Tests */ class ReadlineTest extends AsyncFunSpec { override implicit val executionContext = ExecutionContext.Implicits.global diff --git a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/tty/TTYTest.scala b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/tty/TTYTest.scala index 0595b667f..73a5e3abc 100644 --- a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/tty/TTYTest.scala +++ b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/tty/TTYTest.scala @@ -2,8 +2,7 @@ package io.scalajs.nodejs.tty import org.scalatest.funspec.AnyFunSpec -/** - * TTY Test +/** TTY Test */ class TTYTest extends AnyFunSpec { describe("TTY") { diff --git a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/url/URLObjectTest.scala b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/url/URLObjectTest.scala index a7b074bf0..82009997e 100644 --- a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/url/URLObjectTest.scala +++ b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/url/URLObjectTest.scala @@ -5,8 +5,7 @@ import org.scalatest.funspec.AnyFunSpec import scala.scalajs.js -/** - * URLObject Tests +/** URLObject Tests */ class URLObjectTest extends AnyFunSpec { describe("URLObject") { diff --git a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/vm/VMTest.scala b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/vm/VMTest.scala index 180a188f2..19314cb8a 100644 --- a/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/vm/VMTest.scala +++ b/app/nodejs-v10/src/test/scala/io/scalajs/nodejs/vm/VMTest.scala @@ -5,8 +5,7 @@ import io.scalajs.nodejs.vm.VMTest.{ExpectedData, Sandbox} import scala.scalajs.js import org.scalatest.funspec.AnyFunSpec -/** - * VM Tests +/** VM Tests */ class VMTest extends AnyFunSpec { describe("VM") { @@ -41,13 +40,11 @@ class VMTest extends AnyFunSpec { } } -/** - * VM Test Companion +/** VM Test Companion */ object VMTest { - /** - * Sandbox Object + /** Sandbox Object */ class Sandbox(var animal: String, var count: Int, var name: String) extends js.Object diff --git a/app/nodejs-v12/src/test/scala/io/scalajs/nodejs/buffer/BufferTest.scala b/app/nodejs-v12/src/test/scala/io/scalajs/nodejs/buffer/BufferTest.scala index 9df848ded..95c0e6299 100644 --- a/app/nodejs-v12/src/test/scala/io/scalajs/nodejs/buffer/BufferTest.scala +++ b/app/nodejs-v12/src/test/scala/io/scalajs/nodejs/buffer/BufferTest.scala @@ -3,8 +3,7 @@ package io.scalajs.nodejs.buffer import scala.scalajs.js import org.scalatest.funspec.AnyFunSpec -/** - * Buffer Tests +/** Buffer Tests */ class BufferTest extends AnyFunSpec { it("should support writeBigInt64BE, writeBigInt64LE, writeBigInt64BE and writeBigInt64BE") { diff --git a/app/nodejs-v12/src/test/scala/io/scalajs/nodejs/fs/FsClassesTest.scala b/app/nodejs-v12/src/test/scala/io/scalajs/nodejs/fs/FsClassesTest.scala index cdbfaec46..d6a528f8d 100644 --- a/app/nodejs-v12/src/test/scala/io/scalajs/nodejs/fs/FsClassesTest.scala +++ b/app/nodejs-v12/src/test/scala/io/scalajs/nodejs/fs/FsClassesTest.scala @@ -5,8 +5,7 @@ import org.scalatest.funspec.AnyFunSpec import scala.scalajs.js.JavaScriptException -/** - * File System (Fs) Tests +/** File System (Fs) Tests */ class FsClassesTest extends AnyFunSpec { describe("ReadStream") { diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Assert.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Assert.scala index ee0d4a3b5..26dbb847d 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Assert.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Assert.scala @@ -3,8 +3,7 @@ package io.scalajs.nodejs import scala.scalajs.js import scala.scalajs.js.annotation.JSImport -/** - * The assert module provides a simple set of assertion tests that can be used to test invariants. The module is +/** The assert module provides a simple set of assertion tests that can be used to test invariants. The module is * intended for internal use by Node.js, but can be used in application code via require('assert'). However, assert * is not a testing framework, and is not intended to be used as a general purpose assertion library. * @@ -14,16 +13,14 @@ import scala.scalajs.js.annotation.JSImport @js.native trait Assert extends js.Object { - /** - * An alias of assert.ok() . + /** An alias of assert.ok() . * @param expression the expression to evaluate * @example assert(value[, message]) */ def apply(expression: js.Any, message: String): Unit = js.native def apply(expression: js.Any): Unit = js.native - /** - * Generally identical to assert.deepEqual() with two exceptions. First, primitive values are compared using the + /** Generally identical to assert.deepEqual() with two exceptions. First, primitive values are compared using the * strict equality operator ( === ). Second, object comparisons include a strict equality check of their prototypes. * @example assert.deepStrictEqual(actual, expected[, message]) */ @@ -43,8 +40,7 @@ trait Assert extends js.Object { def doesNotReject(asyncFn: js.Promise[_], message: String): Unit = js.native def doesNotReject(asyncFn: js.Promise[_]): Unit = js.native - /** - * Asserts that the function block does not throw an error. See assert.throws() for more details. + /** Asserts that the function block does not throw an error. See assert.throws() for more details. * When assert.doesNotThrow() is called, it will immediately call the block function. If an error is thrown * and it is the same type as that specified by the error parameter, then an AssertionError is thrown. If the * error is of a different type, or if the error parameter is undefined, the error is propagated back to the caller. @@ -57,56 +53,48 @@ trait Assert extends js.Object { def doesNotThrow(block: js.Function, message: String): Unit = js.native def doesNotThrow(block: js.Function): Unit = js.native - /** - * @see https://nodejs.org/api/assert.html#assert_assert_fail_message + /** @see https://nodejs.org/api/assert.html#assert_assert_fail_message */ def fail(message: String): Unit = js.native - /** - * @see https://nodejs.org/api/assert.html#assert_assert_fail_message + /** @see https://nodejs.org/api/assert.html#assert_assert_fail_message */ def fail(message: js.Error): Unit = js.native @deprecated("Use assert.fail([message]) or other assert functions instead.", "Node.js v10.0.0") def fail(actual: js.Any, expected: js.Any, message: String, operator: String): Unit = js.native - /** - * Throws value if value is truthy. This is useful when testing the error argument in callbacks. + /** Throws value if value is truthy. This is useful when testing the error argument in callbacks. * @example assert.ifError(value) */ def ifError(value: js.Any): Unit = js.native - /** - * Tests for deep strict inequality. Opposite of assert.deepStrictEqual(). + /** Tests for deep strict inequality. Opposite of assert.deepStrictEqual(). * @example assert.notDeepStrictEqual(actual, expected[, message]) */ def notDeepStrictEqual(actual: js.Any, expected: js.Any, message: String): Unit = js.native def notDeepStrictEqual(actual: js.Any, expected: js.Any): Unit = js.native - /** - * Tests strict inequality as determined by the strict not equal operator ( !== ). + /** Tests strict inequality as determined by the strict not equal operator ( !== ). * @example assert.notStrictEqual(actual, expected[, message]) */ def notStrictEqual(actual: js.Any, expected: js.Any, message: String): Unit = js.native def notStrictEqual(actual: js.Any, expected: js.Any): Unit = js.native - /** - * Tests if value is truthy. It is equivalent to assert.equal(!!value, true, message). If value is not truthy, + /** Tests if value is truthy. It is equivalent to assert.equal(!!value, true, message). If value is not truthy, * an AssertionError is thrown with a message property set equal to the value of the message parameter. If the * message parameter is undefined, a default error message is assigned. */ def ok(value: js.Any, message: String): Unit = js.native def ok(value: js.Any): Unit = js.native - /** - * Tests strict equality as determined by the strict equality operator ( === ). + /** Tests strict equality as determined by the strict equality operator ( === ). * @example assert.strictEqual(actual, expected[, message]) */ def strictEqual(actual: js.Any, expected: js.Any, message: String): Unit = js.native def strictEqual(actual: js.Any, expected: js.Any): Unit = js.native - /** - * If the values are not strictly equal, an AssertionError is thrown with a message property set equal to the value + /** If the values are not strictly equal, an AssertionError is thrown with a message property set equal to the value * of the message parameter. If the message parameter is undefined, a default error message is assigned. * @example assert.throws(block[, error][, message]) */ @@ -123,8 +111,7 @@ trait Assert extends js.Object { def rejects(asyncFn: js.Promise[_]): Unit = js.native } -/** - * Assert Singleton +/** Assert Singleton */ @js.native @JSImport("assert", JSImport.Namespace) diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Error.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Error.scala index 6fc5e88bb..2e43c4c95 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Error.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Error.scala @@ -5,8 +5,7 @@ import com.thoughtworks.enableIf import scala.scalajs.js import scala.scalajs.js.annotation.JSGlobal -/** - * Creates a new Error object and sets the error.message property to the provided text message. +/** Creates a new Error object and sets the error.message property to the provided text message. * If an object is passed as message, the text message is generated by calling message.toString(). * The error.stack property will represent the point in the code at which new Error() was called. * Stack traces are dependent on V8's stack trace API. Stack traces extend only to either (a) the @@ -18,8 +17,7 @@ import scala.scalajs.js.annotation.JSGlobal class Error() extends js.Object { def this(message0: String) = this() - /** - * The `error.code` property is a string label that identifies the kind of error. + /** The `error.code` property is a string label that identifies the kind of error. * `error.code` is the most stable way to identify an error. * It will only change between major versions of Node.js. * In contrast, error.message strings may change between any versions of Node.js @@ -27,22 +25,19 @@ class Error() extends js.Object { */ val code: String = js.native - /** - * The error.message property is the string description of the error as set by calling new Error(message). + /** The error.message property is the string description of the error as set by calling new Error(message). * The message passed to the constructor will also appear in the first line of the stack trace of the Error, * however changing this property after the Error object is created may not change the first line of the * stack trace (for example, when error.stack is read before this property is changed). */ val message: String = js.native - /** - * The error.stack property is a string describing the point in the code at which the Error was instantiated. + /** The error.stack property is a string describing the point in the code at which the Error was instantiated. */ val stack: js.Any = js.native } -/** - * Error Singleton +/** Error Singleton */ @js.native @JSGlobal @@ -51,8 +46,7 @@ object Error extends js.Object { // Properties ///////////////////////////////////////////////////////////////////////////////// - /** - * Error.stackTraceLimit + /** Error.stackTraceLimit */ def stackTraceLimit: Int = js.native @@ -60,8 +54,7 @@ object Error extends js.Object { // Methods ///////////////////////////////////////////////////////////////////////////////// - /** - * Creates a .stack property on targetObject, which when accessed returns a string representing the location in the + /** Creates a .stack property on targetObject, which when accessed returns a string representing the location in the * code at which Error.captureStackTrace() was called. * @param targetObject The first line of the trace, instead of being prefixed with ErrorType: message, will be the * result of calling targetObject.toString(). diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Module.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Module.scala index c65972cd7..7ae3fe4d3 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Module.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Module.scala @@ -2,8 +2,7 @@ package io.scalajs.nodejs import scala.scalajs.js -/** - * In each module, the module free variable is a reference to the object representing the current module. +/** In each module, the module free variable is a reference to the object representing the current module. * For convenience, module.exports is also accessible via the exports module-global. module isn't actually * a global but rather local to each module. * @see [[https://nodejs.org/api/modules.html#modules_the_module_object]] @@ -11,14 +10,12 @@ import scala.scalajs.js @js.native trait Module extends js.Object { - /** - * The module objects required by this one. + /** The module objects required by this one. * @example module.children */ var children: js.Array[Module] = js.native - /** - * The module.exports object is created by the Module system. Sometimes this is not acceptable; + /** The module.exports object is created by the Module system. Sometimes this is not acceptable; * many want their module to be an instance of some class. To do this, assign the desired export * object to module.exports. Note that assigning the desired object to exports will simply rebind * the local exports variable, which is probably not what you want to do. @@ -26,34 +23,29 @@ trait Module extends js.Object { */ var exports: js.Object = js.native - /** - * The fully resolved filename to the module. + /** The fully resolved filename to the module. * @example module.filename */ var filename: String = js.native - /** - * The identifier for the module. Typically this is the fully resolved filename. + /** The identifier for the module. Typically this is the fully resolved filename. * @example module.id */ var id: String = js.native - /** - * Whether or not the module is done loading, or is in the process of loading. + /** Whether or not the module is done loading, or is in the process of loading. * @example module.loaded */ var loaded: Boolean = js.native - /** - * The module that first required this one. + /** The module that first required this one. * @example module.parent */ var parent: js.Any = js.native var paths: js.Array[String] = js.native - /** - * The module.require method provides a way to load a module as if require() was called from the original module. + /** The module.require method provides a way to load a module as if require() was called from the original module. *

Note that in order to do this, you must get a reference to the module object. Since require() returns the * module.exports, and the module is typically only available within a specific module's code, it must be * explicitly exported in order to be used. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/StringDecoder.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/StringDecoder.scala index a1505c0f7..ece20a205 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/StringDecoder.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/StringDecoder.scala @@ -6,8 +6,7 @@ import scala.scalajs.js import scala.scalajs.js.annotation.JSImport import scala.scalajs.js.typedarray.{DataView, TypedArray} -/** - * To use this module, do require('string_decoder'). StringDecoder decodes a buffer to a string. It is a simple +/** To use this module, do require('string_decoder'). StringDecoder decodes a buffer to a string. It is a simple * interface to Buffer.toString() but provides additional support for utf8. */ @js.native @@ -15,16 +14,14 @@ import scala.scalajs.js.typedarray.{DataView, TypedArray} class StringDecoder() extends IEventEmitter { def this(encoding: String) = this() - /** - * Returns any trailing bytes that were left in the buffer. + /** Returns any trailing bytes that were left in the buffer. * @example decoder.end() */ def end(buffer: TypedArray[_, _]): String = js.native def end(buffer: DataView): String = js.native def end(): String = js.native - /** - * Returns a decoded string. + /** Returns a decoded string. * @example decoder.write(buffer) */ def write(buffer: TypedArray[_, _]): String = js.native diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/SystemError.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/SystemError.scala index 5ce4eedd3..28e32ced6 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/SystemError.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/SystemError.scala @@ -3,38 +3,32 @@ package io.scalajs.nodejs import scala.scalajs.js import scala.scalajs.js.| -/** - * System Error +/** System Error */ @js.native trait SystemError extends Error { - /** - * The error.errno property is a number or a string. The number is a negative value which corresponds + /** The error.errno property is a number or a string. The number is a negative value which corresponds * to the error code defined in libuv Error handling. See uv-errno.h header file (deps/uv/include/uv-errno.h * in the Node.js source tree) for details. In case of a string, it is the same as error.code. */ val errno: String | Int = js.native - /** - * The error.syscall property is a string describing the syscall that failed. + /** The error.syscall property is a string describing the syscall that failed. */ val syscall: String = js.native - /** - * When present (e.g. in fs or child_process), the error.path property is a string containing + /** When present (e.g. in fs or child_process), the error.path property is a string containing * a relevant invalid pathname. */ val path: String = js.native - /** - * When present (e.g. in net or dgram), the error.address property is a string describing the address + /** When present (e.g. in net or dgram), the error.address property is a string describing the address * to which the connection failed. */ val address: String = js.native - /** - * When present (e.g. in net or dgram), the error.port property is a number representing the connection's + /** When present (e.g. in net or dgram), the error.port property is a number representing the connection's * port that is not available. */ val port: Int = js.native diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/buffer/Buffer.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/buffer/Buffer.scala index f8e9c8da6..02287b93a 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/buffer/Buffer.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/buffer/Buffer.scala @@ -6,15 +6,13 @@ import scala.scalajs.js import scala.scalajs.js.annotation.{JSBracketAccess, JSGlobal, JSImport} import scala.scalajs.js.typedarray.{ArrayBuffer, DataView, TypedArray, Uint8Array} -/** - * @see [[https://nodejs.org/api/buffer.html]] +/** @see [[https://nodejs.org/api/buffer.html]] */ @js.native @JSImport("buffer", "Buffer") class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ -1) { - /** - * The index operator `[index]` can be used to get and set the octet at position `index` in `buf`. + /** The index operator `[index]` can be used to get and set the octet at position `index` in `buf`. * The values refer to individual bytes, so the legal value range is between `0x00` and `0xFF` (hex) or * `0` and `255` (decimal). * @@ -29,8 +27,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - @JSBracketAccess override def apply(index: Int): Short = js.native - /** - * @see [[apply()]] + /** @see [[apply()]] * @param index the given index * @param value the value to replace the existing value at the given index */ @@ -41,8 +38,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - // Methods ///////////////////////////////////////////////////////////////////////////////// - /** - * Compares `buf` with `target` and returns a number indicating whether `buf` comes before, after, or is the same + /** Compares `buf` with `target` and returns a number indicating whether `buf` comes before, after, or is the same * as `target` in sort order. Comparison is based on the actual sequence of bytes in each `Buffer`. * * @param target A Buffer with which to compare `buf` @@ -63,8 +59,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def compare(target: Uint8Array, targetStart: Int): Int = js.native def compare(target: Uint8Array): Int = js.native - /** - * Copies data from a region of `buf` to a region in `target` even if the `target` memory region overlaps with `buf`. + /** Copies data from a region of `buf` to a region in `target` even if the `target` memory region overlaps with `buf`. * * @param target A Buffer to copy into. * @param targetStart The offset within target at which to begin copying to. Default: 0 @@ -80,15 +75,13 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def copy(target: Buffer, targetStart: Int): Int = js.native def copy(target: Buffer): Int = js.native - /** - * Creates and returns an [[Iterator]] of `[index, byte]` pairs from the contents of `buf`. + /** Creates and returns an [[Iterator]] of `[index, byte]` pairs from the contents of `buf`. * * @see [[https://nodejs.org/api/buffer.html#buffer_buf_entries]] */ def entries(): js.Iterator[js.Array[Int]] = js.native - /** - * Returns true if both buf and otherBuffer have exactly the same bytes, false otherwise. + /** Returns true if both buf and otherBuffer have exactly the same bytes, false otherwise. * * @param otherBuffer A `Buffer` or `Uint8Array` with which to compare `buf`. * @return true if both buf and otherBuffer have exactly the same bytes, false otherwise. @@ -127,8 +120,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def includes(value: String, encoding: String): Boolean = js.native def includes(value: String): Boolean = js.native - /** - * Creates and returns an iterator of buf keys (indices). + /** Creates and returns an iterator of buf keys (indices). * @return an [[Iterator]] * @example buf.keys() */ @@ -143,16 +135,14 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def lastIndexOf(value: String, encoding: String): Int = js.native def lastIndexOf(value: String): Int = js.native - /** - * Returns the amount of memory allocated for buf in bytes. + /** Returns the amount of memory allocated for buf in bytes. * Note that this does not necessarily reflect the amount of "usable" data within buf. * @return the amount of memory allocated for buf in bytes. * @example buf.length */ override val length: Int = js.native - /** - * Reads a 64-bit double from buf at the specified offset with specified endian format (readDoubleBE() + /** Reads a 64-bit double from buf at the specified offset with specified endian format (readDoubleBE() * returns big endian, readDoubleLE() returns little endian). * * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be @@ -165,8 +155,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readDoubleBE(offset: Int, noAssert: Boolean): Double = js.native def readDoubleBE(offset: Int): Double = js.native - /** - * Reads a 64-bit double from buf at the specified offset with specified endian format (readDoubleBE() + /** Reads a 64-bit double from buf at the specified offset with specified endian format (readDoubleBE() * returns big endian, readDoubleLE() returns little endian). * * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be @@ -179,8 +168,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readDoubleLE(offset: Int, noAssert: Boolean): Double = js.native def readDoubleLE(offset: Int): Double = js.native - /** - * Reads a 32-bit float from buf at the specified offset with specified endian format (readFloatBE() + /** Reads a 32-bit float from buf at the specified offset with specified endian format (readFloatBE() * returns big endian, readFloatLE() returns little endian). * * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be @@ -193,8 +181,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readFloatBE(offset: Int, noAssert: Boolean): Double = js.native def readFloatBE(offset: Int): Double = js.native - /** - * Reads a 32-bit float from buf at the specified offset with specified endian format (readFloatBE() + /** Reads a 32-bit float from buf at the specified offset with specified endian format (readFloatBE() * returns big endian, readFloatLE() returns little endian). * * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be @@ -207,8 +194,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readFloatLE(offset: Int, noAssert: Boolean): Double = js.native def readFloatLE(offset: Int): Double = js.native - /** - * Reads a signed 8-bit integer from buf at the specified offset. + /** Reads a signed 8-bit integer from buf at the specified offset. * * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be considered undefined behavior. * @@ -221,8 +207,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readInt8(offset: Int, noAssert: Boolean): Int = js.native def readInt8(offset: Int): Int = js.native - /** - * Reads a signed 16-bit integer from buf at the specified offset with the specified endian format + /** Reads a signed 16-bit integer from buf at the specified offset with the specified endian format * (readInt16BE() returns big endian, readInt16LE() returns little endian). * * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be @@ -237,8 +222,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readInt16BE(offset: Int, noAssert: Boolean): Int = js.native def readInt16BE(offset: Int): Int = js.native - /** - * Reads a signed 16-bit integer from buf at the specified offset with the specified endian format + /** Reads a signed 16-bit integer from buf at the specified offset with the specified endian format * (readInt16BE() returns big endian, readInt16LE() returns little endian). * * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be @@ -253,8 +237,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readInt16LE(offset: Int, noAssert: Boolean): Int = js.native def readInt16LE(offset: Int): Int = js.native - /** - * Reads a signed 32-bit integer from buf at the specified offset with the specified endian format + /** Reads a signed 32-bit integer from buf at the specified offset with the specified endian format * (readInt32BE() returns big endian, readInt32LE() returns little endian). * * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be @@ -269,8 +252,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readInt32BE(offset: Int, noAssert: Boolean): Int = js.native def readInt32BE(offset: Int): Int = js.native - /** - * Reads a signed 32-bit integer from buf at the specified offset with the specified endian format + /** Reads a signed 32-bit integer from buf at the specified offset with the specified endian format * (readInt32BE() returns big endian, readInt32LE() returns little endian). * * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be @@ -285,8 +267,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readInt32LE(offset: Int, noAssert: Boolean): Int = js.native def readInt32LE(offset: Int): Int = js.native - /** - * Reads byteLength number of bytes from buf at the specified offset and interprets the result as a + /** Reads byteLength number of bytes from buf at the specified offset and interprets the result as a * two's complement signed value. Supports up to 48 bits of accuracy. * * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be @@ -300,8 +281,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readIntBE(offset: Int, byteLength: Int, noAssert: Boolean): Int = js.native def readIntBE(offset: Int, byteLength: Int): Int = js.native - /** - * Reads byteLength number of bytes from buf at the specified offset and interprets the result as a + /** Reads byteLength number of bytes from buf at the specified offset and interprets the result as a * two's complement signed value. Supports up to 48 bits of accuracy. * * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be @@ -315,8 +295,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readIntLE(offset: Int, byteLength: Int, noAssert: Boolean): Int = js.native def readIntLE(offset: Int, byteLength: Int): Int = js.native - /** - * Reads an unsigned 8-bit integer from buf at the specified offset. + /** Reads an unsigned 8-bit integer from buf at the specified offset. * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be * considered undefined behavior. * @param offset Where to start reading. Must satisfy: 0 <= offset <= buf.length - 1 @@ -327,8 +306,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readUInt8(offset: Int, noAssert: Boolean): Int = js.native def readUInt8(offset: Int): Int = js.native - /** - * Reads an unsigned 16-bit integer from buf at the specified offset with specified endian format + /** Reads an unsigned 16-bit integer from buf at the specified offset with specified endian format * (readUInt16BE() returns big endian, readUInt16LE() returns little endian). * * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be @@ -341,8 +319,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readUInt16BE(offset: Int, noAssert: Boolean): Int = js.native def readUInt16BE(offset: Int): Int = js.native - /** - * Reads an unsigned 16-bit integer from buf at the specified offset with specified endian format + /** Reads an unsigned 16-bit integer from buf at the specified offset with specified endian format * (readUInt16BE() returns big endian, readUInt16LE() returns little endian). * * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be @@ -355,8 +332,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readUInt16LE(offset: Int, noAssert: Boolean): Int = js.native def readUInt16LE(offset: Int): Int = js.native - /** - * Reads an unsigned 32-bit integer from buf at the specified offset with specified endian format + /** Reads an unsigned 32-bit integer from buf at the specified offset with specified endian format * (readUInt32BE() returns big endian, readUInt32LE() returns little endian). * * * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be @@ -369,8 +345,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readUInt32BE(offset: Int, noAssert: Boolean): Int = js.native def readUInt32BE(offset: Int): Int = js.native - /** - * Reads an unsigned 32-bit integer from buf at the specified offset with specified endian format + /** Reads an unsigned 32-bit integer from buf at the specified offset with specified endian format * (readUInt32BE() returns big endian, readUInt32LE() returns little endian). * * * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be @@ -383,8 +358,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readUInt32LE(offset: Int, noAssert: Boolean): Int = js.native def readUInt32LE(offset: Int): Int = js.native - /** - * Reads byteLength number of bytes from buf at the specified offset and interprets the result + /** Reads byteLength number of bytes from buf at the specified offset and interprets the result * as an unsigned integer. Supports up to 48 bits of accuracy. * * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be @@ -398,8 +372,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readUIntBE(offset: Int, byteLength: Int, noAssert: Boolean): Int = js.native def readUIntBE(offset: Int, byteLength: Int): Int = js.native - /** - * Reads byteLength number of bytes from buf at the specified offset and interprets the result + /** Reads byteLength number of bytes from buf at the specified offset and interprets the result * as an unsigned integer. Supports up to 48 bits of accuracy. * * Setting noAssert to true allows offset to be beyond the end of buf, but the result should be @@ -413,8 +386,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def readUIntLE(offset: Int, byteLength: Int, noAssert: Boolean): Int = js.native def readUIntLE(offset: Int, byteLength: Int): Int = js.native - /** - * Returns a new Buffer that references the same memory as the original, but offset and cropped by + /** Returns a new Buffer that references the same memory as the original, but offset and cropped by * the start and end indices. * * Note that modifying the new Buffer slice will modify the memory in the original Buffer because the @@ -428,40 +400,35 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def slice(start: Int): this.type = js.native def slice(): this.type = js.native - /** - * Interprets buf as an array of unsigned 16-bit integers and swaps the byte-order in-place. + /** Interprets buf as an array of unsigned 16-bit integers and swaps the byte-order in-place. * Throws a RangeError if buf.length is not a multiple of 2. * @return A reference to buf * @example buf.swap16() */ def swap16(): this.type = js.native - /** - * Interprets buf as an array of unsigned 32-bit integers and swaps the byte-order in-place. + /** Interprets buf as an array of unsigned 32-bit integers and swaps the byte-order in-place. * Throws a RangeError if buf.length is not a multiple of 4. * @return A reference to buf * @example buf.swap32() */ def swap32(): this.type = js.native - /** - * Interprets buf as an array of unsigned 64-bit numbers and swaps the byte-order in-place. + /** Interprets buf as an array of unsigned 64-bit numbers and swaps the byte-order in-place. * Throws a RangeError if buf.length is not a multiple of 8. * @return A reference to buf * @example buf.swap64() */ def swap64(): this.type = js.native - /** - * Returns a JSON representation of buf. + /** Returns a JSON representation of buf. * JSON.stringify() implicitly calls this function when stringifying a Buffer instance. * @return a JSON representation of buf. * @example buf.toJSON() */ def toJSON(): String = js.native - /** - * Decodes buf to a string according to the specified character encoding in encoding. start and end may be passed + /** Decodes buf to a string according to the specified character encoding in encoding. start and end may be passed * to decode only a subset of buf. * @param encoding The character encoding to decode to. Default: 'utf8' * @param start The byte offset to start decoding at. Default: 0 @@ -473,8 +440,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def toString(encoding: String, start: Int): String = js.native def toString(encoding: String): String = js.native - /** - * Re-encodes the given Buffer instance from one character encoding to another. Returns a new Buffer instance. + /** Re-encodes the given Buffer instance from one character encoding to another. Returns a new Buffer instance. * Throws if the fromEnc or toEnc specify invalid character encodings or if conversion from fromEnc to toEnc * is not permitted. * @param source A Buffer instance @@ -484,16 +450,14 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - */ def transcode(source: Buffer, fromEnc: String, toEnc: String): Buffer = js.native - /** - * Creates and returns an iterator for buf values (bytes). This function is called automatically when a [[Buffer]] + /** Creates and returns an iterator for buf values (bytes). This function is called automatically when a [[Buffer]] * is used in a for..of statement. * @return an iterator for buf values (bytes) * @example buf.values() */ def values(): js.Iterator[Int] = js.native - /** - * Writes string to buf at offset according to the character encoding in encoding. The length parameter is + /** Writes string to buf at offset according to the character encoding in encoding. The length parameter is * the number of bytes to write. If buf did not contain enough space to fit the entire string, only a partial * amount of string will be written. However, partially encoded characters will not be written. * @param string String to be written to buf @@ -509,8 +473,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def write(string: String, offset: Int): Int = js.native def write(string: String): Int = js.native - /** - * Writes value to buf at the specified offset with specified endian format (writeDoubleBE() writes big endian, + /** Writes value to buf at the specified offset with specified endian format (writeDoubleBE() writes big endian, * writeDoubleLE() writes little endian). value should be a valid 64-bit double. Behavior is undefined when value * is anything other than a 64-bit double. * @@ -525,8 +488,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeDoubleBE(value: Double, offset: Int, noAssert: Boolean): Int = js.native def writeDoubleBE(value: Double, offset: Int): Int = js.native - /** - * Writes value to buf at the specified offset with specified endian format (writeDoubleBE() writes big endian, + /** Writes value to buf at the specified offset with specified endian format (writeDoubleBE() writes big endian, * writeDoubleLE() writes little endian). value should be a valid 64-bit double. Behavior is undefined when value * is anything other than a 64-bit double. * @@ -541,8 +503,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeDoubleLE(value: Double, offset: Int, noAssert: Boolean): Int = js.native def writeDoubleLE(value: Double, offset: Int): Int = js.native - /** - * Writes value to buf at the specified offset with specified endian format (writeFloatBE() writes big endian, + /** Writes value to buf at the specified offset with specified endian format (writeFloatBE() writes big endian, * writeFloatLE() writes little endian). value should be a valid 32-bit float. Behavior is undefined when value * is anything other than a 32-bit float. * @@ -557,8 +518,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeFloatBE(value: Float, offset: Int, noAssert: Boolean): Int = js.native def writeFloatBE(value: Float, offset: Int): Int = js.native - /** - * Writes value to buf at the specified offset with specified endian format (writeFloatBE() writes big endian, + /** Writes value to buf at the specified offset with specified endian format (writeFloatBE() writes big endian, * writeFloatLE() writes little endian). value should be a valid 32-bit float. Behavior is undefined when value * is anything other than a 32-bit float. * @@ -573,8 +533,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeFloatLE(value: Float, offset: Int, noAssert: Boolean): Int = js.native def writeFloatLE(value: Float, offset: Int): Int = js.native - /** - * Writes value to buf at the specified offset. value should be a valid signed 8-bit integer. Behavior is + /** Writes value to buf at the specified offset. value should be a valid signed 8-bit integer. Behavior is * undefined when value is anything other than a signed 8-bit integer. * * Setting noAssert to true allows the encoded form of value to extend beyond the end of buf, but the result @@ -590,8 +549,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeInt8(value: Int, offset: Int, noAssert: Boolean): Int = js.native def writeInt8(value: Int, offset: Int): Int = js.native - /** - * Writes value to buf at the specified offset with specified endian format (writeInt16BE() writes big endian, + /** Writes value to buf at the specified offset with specified endian format (writeInt16BE() writes big endian, * writeInt16LE() writes little endian). value should be a valid signed 16-bit integer. Behavior is undefined * when value is anything other than a signed 16-bit integer. * @@ -608,8 +566,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeInt16BE(value: Int, offset: Int, noAssert: Boolean): Int = js.native def writeInt16BE(value: Int, offset: Int): Int = js.native - /** - * Writes value to buf at the specified offset with specified endian format (writeInt16BE() writes big endian, + /** Writes value to buf at the specified offset with specified endian format (writeInt16BE() writes big endian, * writeInt16LE() writes little endian). value should be a valid signed 16-bit integer. Behavior is undefined * when value is anything other than a signed 16-bit integer. * @@ -626,8 +583,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeInt16LE(value: Int, offset: Int, noAssert: Boolean): Int = js.native def writeInt16LE(value: Int, offset: Int): Int = js.native - /** - * Writes value to buf at the specified offset with specified endian format (writeInt32BE() writes big endian, + /** Writes value to buf at the specified offset with specified endian format (writeInt32BE() writes big endian, * writeInt32LE() writes little endian). value should be a valid signed 32-bit integer. Behavior is undefined * when value is anything other than a signed 32-bit integer. * @@ -644,8 +600,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeInt32BE(value: Int, offset: Int, noAssert: Boolean): Int = js.native def writeInt32BE(value: Int, offset: Int): Int = js.native - /** - * Writes value to buf at the specified offset with specified endian format (writeInt32BE() writes big endian, + /** Writes value to buf at the specified offset with specified endian format (writeInt32BE() writes big endian, * writeInt32LE() writes little endian). value should be a valid signed 32-bit integer. Behavior is undefined * when value is anything other than a signed 32-bit integer. * @@ -662,8 +617,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeInt32LE(value: Int, offset: Int, noAssert: Boolean): Int = js.native def writeInt32LE(value: Int, offset: Int): Int = js.native - /** - * Writes byteLength bytes of value to buf at the specified offset. Supports up to 48 bits of accuracy. + /** Writes byteLength bytes of value to buf at the specified offset. Supports up to 48 bits of accuracy. * Behavior is undefined when value is anything other than a signed integer. * * Setting noAssert to true allows the encoded form of value to extend beyond the end of buf, but the @@ -678,8 +632,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeIntBE(value: Int, offset: Int, byteLength: Int, noAssert: Boolean): Int = js.native def writeIntBE(value: Int, offset: Int, byteLength: Int): Int = js.native - /** - * Writes byteLength bytes of value to buf at the specified offset. Supports up to 48 bits of accuracy. + /** Writes byteLength bytes of value to buf at the specified offset. Supports up to 48 bits of accuracy. * Behavior is undefined when value is anything other than a signed integer. * * Setting noAssert to true allows the encoded form of value to extend beyond the end of buf, but the @@ -694,8 +647,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeIntLE(value: Int, offset: Int, byteLength: Int, noAssert: Boolean): Int = js.native def writeIntLE(value: Int, offset: Int, byteLength: Int): Int = js.native - /** - * Writes value to buf at the specified offset. value should be a valid unsigned 8-bit integer. Behavior + /** Writes value to buf at the specified offset. value should be a valid unsigned 8-bit integer. Behavior * is undefined when value is anything other than an unsigned 8-bit integer. * * Setting noAssert to true allows the encoded form of value to extend beyond the end of buf, but the result @@ -709,8 +661,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeUInt8(value: Int, offset: Int, noAssert: Boolean): Int = js.native def writeUInt8(value: Int, offset: Int): Int = js.native - /** - * Writes value to buf at the specified offset with specified endian format (writeUInt16BE() writes big endian, + /** Writes value to buf at the specified offset with specified endian format (writeUInt16BE() writes big endian, * writeUInt16LE() writes little endian). value should be a valid unsigned 16-bit integer. Behavior is undefined * when value is anything other than an unsigned 16-bit integer. * @@ -725,8 +676,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeUInt16BE(value: Int, offset: Int, noAssert: Boolean): Int = js.native def writeUInt16BE(value: Int, offset: Int): Int = js.native - /** - * Writes value to buf at the specified offset with specified endian format (writeUInt16BE() writes big endian, + /** Writes value to buf at the specified offset with specified endian format (writeUInt16BE() writes big endian, * writeUInt16LE() writes little endian). value should be a valid unsigned 16-bit integer. Behavior is undefined * when value is anything other than an unsigned 16-bit integer. * @@ -741,8 +691,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeUInt16LE(value: Int, offset: Int, noAssert: Boolean): Int = js.native def writeUInt16LE(value: Int, offset: Int): Int = js.native - /** - * Writes value to buf at the specified offset with specified endian format (writeUInt32BE() writes big endian, + /** Writes value to buf at the specified offset with specified endian format (writeUInt32BE() writes big endian, * writeUInt32LE() writes little endian). value should be a valid unsigned 32-bit integer. Behavior is undefined * when value is anything other than an unsigned 32-bit integer. * @@ -757,8 +706,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeUInt32BE(value: Int, offset: Int, noAssert: Boolean): Int = js.native def writeUInt32BE(value: Int, offset: Int): Int = js.native - /** - * Writes value to buf at the specified offset with specified endian format (writeUInt32BE() writes big endian, + /** Writes value to buf at the specified offset with specified endian format (writeUInt32BE() writes big endian, * writeUInt32LE() writes little endian). value should be a valid unsigned 32-bit integer. Behavior is undefined * when value is anything other than an unsigned 32-bit integer. * @@ -773,8 +721,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeUInt32LE(value: Int, offset: Int, noAssert: Boolean): Int = js.native def writeUInt32LE(value: Int, offset: Int): Int = js.native - /** - * Writes byteLength bytes of value to buf at the specified offset. Supports up to 48 bits of accuracy. + /** Writes byteLength bytes of value to buf at the specified offset. Supports up to 48 bits of accuracy. * Behavior is undefined when value is anything other than an unsigned integer. * * Setting noAssert to true allows the encoded form of value to extend beyond the end of buf, but the @@ -789,8 +736,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeUIntBE(value: Int, offset: Int, byteLength: Int, noAssert: Boolean): Int = js.native def writeUIntBE(value: Int, offset: Int, byteLength: Int): Int = js.native - /** - * Writes byteLength bytes of value to buf at the specified offset. Supports up to 48 bits of accuracy. + /** Writes byteLength bytes of value to buf at the specified offset. Supports up to 48 bits of accuracy. * Behavior is undefined when value is anything other than an unsigned integer. * * Setting noAssert to true allows the encoded form of value to extend beyond the end of buf, but the @@ -805,16 +751,14 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - def writeUIntLE(value: Int, offset: Int, byteLength: Int, noAssert: Boolean): Int = js.native def writeUIntLE(value: Int, offset: Int, byteLength: Int): Int = js.native - /** - * @see https://nodejs.org/api/buffer.html#buffer_buf_readbiguint64be_offset + /** @see https://nodejs.org/api/buffer.html#buffer_buf_readbiguint64be_offset */ @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def readBigInt64BE( offset: Int ): scalajs.js.BigInt = js.native @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def readBigInt64BE(): scalajs.js.BigInt = js.native - /** - * @see https://nodejs.org/api/buffer.html#buffer_buf_readbiguint64le_offset + /** @see https://nodejs.org/api/buffer.html#buffer_buf_readbiguint64le_offset */ @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def readBigUInt64LE( offset: Int @@ -822,8 +766,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def readBigUInt64LE(): scalajs.js.BigInt = js.native - /** - * @see https://nodejs.org/api/buffer.html#buffer_buf_writebigint64be_value_offset + /** @see https://nodejs.org/api/buffer.html#buffer_buf_writebigint64be_value_offset */ @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def writeBigInt64BE(value: scalajs.js.BigInt, offset: Int @@ -832,8 +775,7 @@ class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ - value: scalajs.js.BigInt ): Int = js.native - /** - * @see https://nodejs.org/api/buffer.html#buffer_buf_writebigint64le_value_offset + /** @see https://nodejs.org/api/buffer.html#buffer_buf_writebigint64le_value_offset */ @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def writeBigInt64LE(value: scalajs.js.BigInt, offset: Int @@ -850,8 +792,7 @@ object Buffer extends js.Object { // Properties ///////////////////////////////////////////////////////////////////////////////// - /** - * This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling. + /** This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling. * This value may be modified. */ var poolSize: Int = js.native @@ -860,8 +801,7 @@ object Buffer extends js.Object { // Methods ///////////////////////////////////////////////////////////////////////////////// - /** - * Allocates a new `Buffer` of `size` bytes. + /** Allocates a new `Buffer` of `size` bytes. * If `fill` is `undefined`, the `Buffer` will be zero-filled. * * @param size The desired length of the new `Buffer` @@ -876,8 +816,7 @@ object Buffer extends js.Object { def alloc(size: Int, fill: Int): Buffer = js.native def alloc(size: Int): Buffer = js.native - /** - * Allocates a new `Buffer` of `size` bytes. + /** Allocates a new `Buffer` of `size` bytes. * If `size` is larger than [[constants.MAX_LENGTH]] or smaller than `0`, `ERR_INVALID_OPT_VALUE` is thrown. * A zero-length `Buffer` is created if size is `0`. * @@ -887,8 +826,7 @@ object Buffer extends js.Object { */ def allocUnsafe(size: Int): Buffer = js.native - /** - * Allocates a new `Buffer` of `size` bytes. + /** Allocates a new `Buffer` of `size` bytes. * If `size` is larger than [[constants.MAX_LENGTH]] or smaller than `0`, `ERR_INVALID_OPT_VALUE` is thrown. * A zero-length `Buffer` is created if size is `0`. * @@ -898,8 +836,7 @@ object Buffer extends js.Object { */ def allocUnsafeSlow(size: Int): Buffer = js.native - /** - * Returns the actual byte length of a string. + /** Returns the actual byte length of a string. * This is not the same as `String.prototype.length` since that returns the number of characters in a string. * * @param string A value to calculate the length of. @@ -913,16 +850,14 @@ object Buffer extends js.Object { def byteLength(string: DataView): Int = js.native def byteLength(string: ArrayBuffer): Int = js.native - /** - * Compares `buf1` to `buf2` typically for the purpose of sorting arrays of `Buffer` instances. + /** Compares `buf1` to `buf2` typically for the purpose of sorting arrays of `Buffer` instances. * This is equivalent to calling `buf1.compare(buf2)`. * * @see [[https://nodejs.org/api/buffer.html#buffer_class_method_buffer_compare_buf1_buf2]] */ def compare(buf1: Uint8Array, buf2: Uint8Array): Int = js.native - /** - * Returns a new `Buffer` which is the result of concatenating all the `Buffer`s in the `list` together. + /** Returns a new `Buffer` which is the result of concatenating all the `Buffer`s in the `list` together. * * @param list List of [[Buffer]] or [[Uint8Array]] instances to concat. * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. @@ -932,8 +867,7 @@ object Buffer extends js.Object { def concat[B <: Uint8Array](list: js.Array[B], totalLength: Int): Buffer = js.native def concat[B <: Uint8Array](list: js.Array[B]): Buffer = js.native - /** - * When passed a reference to the .buffer property of a TypedArray instance, the newly created Buffer + /** When passed a reference to the .buffer property of a TypedArray instance, the newly created Buffer * will share the same allocated memory as the TypedArray. * * @see [[https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length]] @@ -942,8 +876,7 @@ object Buffer extends js.Object { def from(arrayBuffer: ArrayBuffer, byteOffset: Int): Buffer = js.native def from(arrayBuffer: ArrayBuffer): Buffer = js.native - /** - * Copies the passed `buffer` data onto a new `Buffer` instance. + /** Copies the passed `buffer` data onto a new `Buffer` instance. * * @param buffer An existing [[Buffer]] or [[Uint8Array]] from which to copy data. * @@ -951,15 +884,13 @@ object Buffer extends js.Object { */ def from(buffer: Uint8Array): Buffer = js.native - /** - * Allocates a new `Buffer` using an `array` of octets. + /** Allocates a new `Buffer` using an `array` of octets. * * @see [[https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_array]] */ def from(array: js.Array[Int]): Buffer = js.native - /** - * Creates a new `Buffer` containing `string`. + /** Creates a new `Buffer` containing `string`. * The `encoding` parameter identifies the character encoding of `string`. * @param str A string to encode. * @param encoding The encoding of string. Default: 'utf8'. @@ -968,8 +899,7 @@ object Buffer extends js.Object { */ def from(str: String, encoding: String): Buffer = js.native - /** - * Creates a new `Buffer` containing `string`. + /** Creates a new `Buffer` containing `string`. * UTF-8 encoding is used. * * @param str A string to encode. @@ -978,16 +908,14 @@ object Buffer extends js.Object { */ def from(str: String): Buffer = js.native - /** - * Returns `true` if `obj` is a `Buffer`, `false` otherwise. + /** Returns `true` if `obj` is a `Buffer`, `false` otherwise. * @param obj the given object * * @see [[https://nodejs.org/api/buffer.html#buffer_class_method_buffer_isbuffer_obj]] */ def isBuffer(obj: js.Object): Boolean = js.native - /** - * Returns true if `encoding` contains a supported character encoding, or false otherwise. + /** Returns true if `encoding` contains a supported character encoding, or false otherwise. * * @see [[https://nodejs.org/api/buffer.html#buffer_class_method_buffer_isencoding_encoding]] */ diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/buffer/package.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/buffer/package.scala index 1686dadfd..20947d6e1 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/buffer/package.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/buffer/package.scala @@ -4,21 +4,18 @@ import scala.scalajs.js import scala.scalajs.js.annotation.JSImport import scala.scalajs.js.typedarray.Uint8Array -/** - * buffer package object +/** buffer package object */ package object buffer { ///////////////////////////////////////////////////////////////////////////////// // Buffer Extensions ///////////////////////////////////////////////////////////////////////////////// - /** - * Buffer Extensions + /** Buffer Extensions */ implicit final class BufferExtensions(private val buffer: Buffer) extends AnyVal { - /** - * Syntactic sugar for concatenating a buffer + /** Syntactic sugar for concatenating a buffer * * @param aBuffer another buffer * @return a new buffer with the concatenated contents of both buffers @@ -26,15 +23,13 @@ package object buffer { @inline def +(aBuffer: Buffer): Buffer = Buffer.concat(js.Array(buffer, aBuffer)) - /** - * Returns the actual byte length of a string. This is not the same as String.prototype.length since that returns + /** Returns the actual byte length of a string. This is not the same as String.prototype.length since that returns * the number of characters in a string. */ @inline def byteLength(encoding: String): Int = Buffer.byteLength(buffer) - /** - * Returns the hex-formatted string + /** Returns the hex-formatted string * * @return the hex-formatted string */ @@ -43,8 +38,7 @@ package object buffer { js.Iterator.IteratorOps(buffer.entries()).toIterator.flatMap(_.lastOption).map(n => f"$n%02x").mkString } - /** - * Re-encodes the given `Buffer` or `Uint8Array` instance from one character encoding to another. + /** Re-encodes the given `Buffer` or `Uint8Array` instance from one character encoding to another. * Returns a new `Buffer` instance. * * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if conversion from `fromEnc` to `toEnc`` @@ -64,8 +58,7 @@ package object buffer { def transcode(source: Uint8Array, fromEnc: String, toEnc: String): Buffer = BufferNamespace.transcode(source, fromEnc, toEnc) - /** - * Returns the maximum number of bytes that will be returned when buf.inspect() is called. + /** Returns the maximum number of bytes that will be returned when buf.inspect() is called. * This can be overridden by user modules. See util.inspect() for more details on buf.inspect() behavior. * * Note that this is a property on the buffer module returned by require('buffer'), not on the @@ -73,8 +66,7 @@ package object buffer { */ val INSPECT_MAX_BYTES: UID = BufferNamespace.INSPECT_MAX_BYTES - /** - * On 32-bit architectures, this value is (2^30)-1 (~1GB). On 64-bit architectures, this value is (2^31)-1 (~2GB).F + /** On 32-bit architectures, this value is (2^30)-1 (~1GB). On 64-bit architectures, this value is (2^31)-1 (~2GB).F * Note that this is a property on the buffer module returned by require('buffer'), not on the Buffer global or a Buffer instance. */ val kMaxLength: Double = BufferNamespace.kMaxLength @@ -91,16 +83,14 @@ package object buffer { @JSImport("buffer", "constants") object constants extends js.Object { - /** - * The largest size allowed for a single `Buffer` instance. + /** The largest size allowed for a single `Buffer` instance. * * On 32-bit architectures, this value is `(2^30)-1` (~1GB). * On 64-bit architectures, this value is `(2^31)-1` (~2GB). */ val MAX_LENGTH: Double = js.native - /** - * The largest length allowed for a single `String` instance. + /** The largest length allowed for a single `String` instance. * * Represents the largest `length` that a `String` primitive can have, counted in UTF-16 code units. * diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/ChildProcess.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/ChildProcess.scala index 5f7fa4d1d..1fe25c49c 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/ChildProcess.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/ChildProcess.scala @@ -7,8 +7,7 @@ import io.scalajs.nodejs.events.IEventEmitter import scala.scalajs.js import scala.scalajs.js.annotation.JSImport -/** - * The child_process module provides the ability to spawn child processes in a manner that is similar, +/** The child_process module provides the ability to spawn child processes in a manner that is similar, * but not identical, to popen(3). This capability is primarily provided by the child_process.spawn() function. * * @see https://nodejs.org/api/child_process.html @@ -46,8 +45,7 @@ trait ForkedChildProcess extends ChildProcess { def send(message: js.Any): Boolean = js.native } -/** - * @see https://nodejs.org/api/child_process.html +/** @see https://nodejs.org/api/child_process.html */ @JSImport("child_process", JSImport.Namespace) @js.native diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/ExecFileSyncOptions.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/ExecFileSyncOptions.scala index 7e2a40302..b1c6a6ec4 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/ExecFileSyncOptions.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/ExecFileSyncOptions.scala @@ -6,8 +6,7 @@ import net.exoego.scalajs.types.util.Factory import scala.scalajs.js import scala.scalajs.js.| -/** - * Spawns a shell then executes the command within that shell, buffering any generated output. +/** Spawns a shell then executes the command within that shell, buffering any generated output. * * Note: Never pass unsanitized user input to this function. Any input containing shell meta-characters * may be used to trigger arbitrary command execution. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/ExecOptions.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/ExecOptions.scala index 61f66f053..032bbd62c 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/ExecOptions.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/ExecOptions.scala @@ -6,8 +6,7 @@ import _root_.net.exoego.scalajs.types.util.Factory import scala.scalajs.js import scala.scalajs.js.| -/** - * Spawns a shell then executes the command within that shell, buffering any generated output. +/** Spawns a shell then executes the command within that shell, buffering any generated output. * * Note: Never pass unsanitized user input to this function. Any input containing shell meta-characters * may be used to trigger arbitrary command execution. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/SpawnSyncOptions.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/SpawnSyncOptions.scala index 447ba242e..0dc6c3c04 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/SpawnSyncOptions.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/child_process/SpawnSyncOptions.scala @@ -5,8 +5,7 @@ import io.scalajs.nodejs.{GID, UID} import scala.scalajs.js import scala.scalajs.js.| -/** - * Spawns a shell then executes the command within that shell, buffering any generated output. +/** Spawns a shell then executes the command within that shell, buffering any generated output. * * Note: Never pass unsanitized user input to this function. Any input containing shell meta-characters * may be used to trigger arbitrary command execution. diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/cluster/Address.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/cluster/Address.scala index 6769010b5..e3afe1a6f 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/cluster/Address.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/cluster/Address.scala @@ -9,8 +9,7 @@ trait Address extends js.Object { def port: Int = js.native - /** - * The addressType is one of: + /** The addressType is one of: * 4 (TCPv4) * 6 (TCPv6) * -1 (unix domain socket) diff --git a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/cluster/Cluster.scala b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/cluster/Cluster.scala index 21b9dd891..7758f06a9 100644 --- a/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/cluster/Cluster.scala +++ b/app/nodejs-v14/src/main/scala/io/scalajs/nodejs/cluster/Cluster.scala @@ -5,8 +5,7 @@ import io.scalajs.nodejs.events.IEventEmitter import scala.scalajs.js import scala.scalajs.js.annotation.JSImport -/** - * A single instance of Node.js runs in a single thread. To take advantage of multi-core systems the user will +/** A single instance of Node.js runs in a single thread. To take advantage of multi-core systems the user will * sometimes want to launch a cluster of Node.js processes to handle the load. * * The cluster module allows you to easily create child processes that all share server ports. @@ -25,19 +24,16 @@ trait Cluster extends IEventEmitter { // Properties ///////////////////////////////////////////////////////////////////////////////// - /** - * True if the process is a master. This is determined by the process.env.NODE_UNIQUE_ID. + /** True if the process is a master. This is determined by the process.env.NODE_UNIQUE_ID. * If process.env.NODE_UNIQUE_ID is undefined, then isMaster is true. */ def isMaster: Boolean = js.native - /** - * True if the process is not a master (it is the negation of cluster.isMaster). + /** True if the process is not a master (it is the negation of cluster.isMaster). */ def isWorker: Boolean = js.native - /** - * The scheduling policy, either cluster.SCHED_RR for round-robin or cluster.SCHED_NONE to leave it to the operating + /** The scheduling policy, either cluster.SCHED_RR for round-robin or cluster.SCHED_NONE to leave it to the operating * system. This is a global setting and effectively frozen once you spawn the first worker or call cluster.setupMaster(), * whatever comes first. * @@ -49,20 +45,17 @@ trait Cluster extends IEventEmitter { */ def schedulingPolicy: Int = js.native - /** - * After calling .setupMaster() (or .fork()) this settings object will contain the settings, including the default values. + /** After calling .setupMaster() (or .fork()) this settings object will contain the settings, including the default values. * It is effectively frozen after being set, because .setupMaster() can only be called once. * This object is not supposed to be changed or set manually, by you. */ def settings: ClusterSettings = js.native - /** - * A reference to the current worker object. Not available in the master process. + /** A reference to the current worker object. Not available in the master process. */ def worker: Worker = js.native - /** - * A hash that stores the active worker objects, keyed by id field. Makes it easy to loop through all the workers. + /** A hash that stores the active worker objects, keyed by id field. Makes it easy to loop through all the workers. * It is only available in the master process. * * A worker is removed from cluster.workers after the worker has disconnected and exited. The order between these @@ -75,8 +68,7 @@ trait Cluster extends IEventEmitter { // Methods ///////////////////////////////////////////////////////////////////////////////// - /** - * When they are disconnected all internal handles will be closed, allowing the master process to die gracefully if + /** When they are disconnected all internal handles will be closed, allowing the master process to die gracefully if * no other event is waiting. * * The method takes an optional callback argument which will be called when finished. @@ -87,8 +79,7 @@ trait Cluster extends IEventEmitter { def disconnect(callback: js.Function): Unit = js.native def disconnect(): Unit = js.native - /** - * Spawn a new worker process. + /** Spawn a new worker process. * This can only be called from the master process. * @return a new worker * @example cluster.fork([env]) @@ -96,8 +87,7 @@ trait Cluster extends IEventEmitter { def fork(env: js.Any): Worker = js.native def fork(): Worker = js.native - /** - * setupMaster is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings. + /** setupMaster is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings. * Note that: *