Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ForEachObjectArray.js #675

Open
wants to merge 2 commits into
base: v6
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,14 @@ module.exports = async (d) => {

let el = {};
let i = 0;
for (const key in d.data.objects[name]) {
if (d.data.objects[name].hasOwnProperty(key)) {
for (const key in d.data.objects[name][property]) {
if (d.data.objects[name][property].hasOwnProperty(key)) {
Comment on lines +27 to +28
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need a check before this for loop to see if d.data.objects[name][property] is an iterable else it will error out


el[key] = d.data.objects[name][key];
el[key] = d.data.objects[name][property][key];
const c = { ...cmd };
c.code = c.code.replaceAll("{value}", el);

if(!Array.isArray(el[key])) continue;
el[key] = d.data.objects[name][key]
let parsedResult = JSON.stringify(el[property][i])
let parsedResult = JSON.stringify(el[key])
await Interpreter(
d.client,
d.message,
Expand All @@ -59,4 +57,4 @@ if (endCmd.trim() !== "") {
return {
code: d.util.setCode(data)
};
};
};
Loading