[gjs/ewlsh/text-encoding: 18/24] ByteArray: Add jsdoc to ByteArray.fromArray()
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/ewlsh/text-encoding: 18/24] ByteArray: Add jsdoc to ByteArray.fromArray()
- Date: Mon, 14 Jun 2021 05:07:44 +0000 (UTC)
commit 2a9c70c1fdf87b0640074c842de36ec438389685
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]