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

Function listify

wxapp/junpinhui.js:137–144  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

135}
136
137function listify(value) {
138 if (Array.isArray(value)) return value;
139 if (!value || typeof value !== "object") return [];
140 for (const key of ["list", "data", "records", "items", "rows"]) {
141 if (Array.isArray(value[key])) return value[key];
142 }
143 return [];
144}
145
146function pickId(item = {}) {
147 for (const key of ["id", "sorghum_id", "sorghumId", "member_sorghum_id", "memberSorghumId", "land_id", "landId"]) {

Callers 3

queryFarmMethod · 0.85
queryTasksMethod · 0.85
doQuestionTaskMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected