jonny@neuromatch.social ("jonny (nonvenomous)") wrote:
at least that PR could be considered an interpretation of what "butter" could mean.
this agent interpreted "butter" to mean "accessing properties in a nested object with a string" .... butter-ly? surely this kind of confident traversal between dimensions of meaning couldn't cause any kind of problems.
just look at those fallbacks, magnificent. i love "if value is not undefined, value, otherwise undefined."
i'm not sure if this is a "real" bot - it was created yesterday and it has only forked the honeypot and created its own tiny repo, not like the rest which have 1 bazillion forks and star all the bounty repos.

![[a javascript function for accessing nested properties in an object. given some nested object and a string like "first.second.third", split the string on periods and access successive layers of nesting with each of the keys] export function getNestedProperty(obj, path, defaultValue) { if (!obj || typeof obj !== 'object' || obj === null) { return defaultValue !== undefined ? defaultValue : undefined; } const parts = path.split('.'); let current = obj; for (let i = 0; i < parts.length; i++) { const part = parts[i]; if (current === null || typeof current !== 'object' || !current.hasOwnProperty(part)) { return defaultValue !== undefined ? defaultValue : undefined; } current = current[part]; } return current !== undefined ? current : (defaultValue !== undefined ? defaultValue : undefined); }](https://files.mastodon.social/cache/media_attachments/files/116/834/900/385/516/666/original/b35050a0da1a2e65.png)