MCPcopy Create free account
hub / github.com/basecamp/omarchy / parseDisplays

Function parseDisplays

shell/plugins/panels/monitor/Model.js:94–112  ·  view source on GitHub ↗
(raw)

Source from the content-addressed store, hash-verified

92}
93
94function parseDisplays(raw) {
95 var displays = []
96 try {
97 displays = raw ? JSON.parse(String(raw)) : []
98 } catch (e) {
99 displays = []
100 }
101 if (!Array.isArray(displays)) displays = []
102
103 var count = 0
104 for (var i = 0; i < displays.length; i++) {
105 if (displays[i] && displays[i].enabled) count++
106 }
107
108 return {
109 displays: displays,
110 enabledDisplayCount: count
111 }
112}
113
114if (typeof module !== "undefined") {
115 module.exports = {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected