[gjs: 3/6] Not PR focus: pretty printing empty objects as {}
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 3/6] Not PR focus: pretty printing empty objects as {}
- Date: Mon, 25 Jul 2022 03:38:21 +0000 (UTC)
commit e9c26a1a6473085958f78ddbae47549867737f49
Author: Nasah <nasahnash19 gmail com>
Date: Sat Jul 16 00:57:17 2022 +0100
Not PR focus: pretty printing empty objects as {}
modules/script/_bootstrap/default.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/modules/script/_bootstrap/default.js b/modules/script/_bootstrap/default.js
index d334a741b..91b5eca13 100644
--- a/modules/script/_bootstrap/default.js
+++ b/modules/script/_bootstrap/default.js
@@ -72,7 +72,8 @@
break;
}
}
- return `{ ${formattedObject.join(', ')} }`;
+ return Object.keys(formattedObject).length === 0 ? '{}'
+ : `{ ${formattedObject.join(', ')} }`;
}
function formatArray(arr, printedObjects) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]