mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
fuck i owe almeida a donut now
Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
parent
12d59bc238
commit
7e6fc1f196
1 changed files with 9 additions and 4 deletions
|
@ -538,11 +538,16 @@ const baseValues = {
|
|||
return math_constants[str.toLowerCase()] ?? "";
|
||||
},
|
||||
map(obj, key) {
|
||||
if (typeof obj !== "object" || typeof key !== "string" || typeof obj === "function" || !obj) return "";
|
||||
return actualMap(obj, key);
|
||||
|
||||
function actualMap(obj, key, depth = 0) {
|
||||
if (depth > 5) return "";
|
||||
if (!obj || !key || typeof obj !== "object" || typeof key !== "string") return "";
|
||||
if (Array.isArray(obj)) {
|
||||
return obj.map((tobj) => tobj[key]);
|
||||
return obj.map((tobj) => actualMap(tobj, key, depth + 1));
|
||||
}
|
||||
return obj[key];
|
||||
}
|
||||
},
|
||||
cases(mod, ...cases) {
|
||||
if (cases.length === 0) return "";
|
||||
|
|
Loading…
Add table
Reference in a new issue