MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / flattenTaskList

Method flattenTaskList

daily/hyjk.js:243–254  ·  view source on GitHub ↗
(taskResult)

Source from the content-addressed store, hash-verified

241 }
242
243 flattenTaskList(taskResult) {
244 if (!taskResult || taskResult.code !== 0) return [];
245 const root = taskResult.result;
246 if (Array.isArray(root)) return root;
247 if (Array.isArray(root?.list)) {
248 if (root.list.some(item => item && Object.prototype.hasOwnProperty.call(item, "taskId"))) {
249 return root.list;
250 }
251 return root.list.flatMap(group => Array.isArray(group?.taskList) ? group.taskList : []);
252 }
253 return [];
254 }
255
256 async autoByUserOperation() {
257 await this.autoTodayFullWaterTask();

Callers 1

autoTasksMethod · 0.95

Calls 1

callMethod · 0.80

Tested by

no test coverage detected