[gjs] ByteArray: Add jsdoc to ByteArray.fromArray()



commit e1600ef2f43d109f5a7dbe586acdf27a38a30a1c
Author: Evan Welsh <contact evanwelsh com>
Date:   Sun Jun 13 17:54:18 2021 -0700

    ByteArray: Add jsdoc to ByteArray.fromArray()

 modules/script/byteArray.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/modules/script/byteArray.js b/modules/script/byteArray.js
index fad022d2..6d4b0f51 100644
--- a/modules/script/byteArray.js
+++ b/modules/script/byteArray.js
@@ -7,8 +7,13 @@ var {fromGBytes, fromString, toGBytes, toString} = imports._byteArrayNative;
 
 // For backwards compatibility
 
-function fromArray(a) {
-    return new ByteArray(Uint8Array.from(a));
+/**
+ * @param {Iterable<number>} array an iterable to convert into a ByteArray
+ *   wrapper
+ * @returns {ByteArray}
+ */
+function fromArray(array) {
+    return new ByteArray(Uint8Array.from(array));
 }
 
 var ByteArray = class ByteArray {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]