This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convertToAnsiFormatting(text) { | |
const colorMap = { | |
red: "31", | |
green: "32", | |
yellow: "33", | |
blue: "34", | |
pink: "35", | |
teal: "36", | |
white: "37", | |
gray: "30", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const deepSearchForMethod = (obj, methodName, path = '', visited = new Set(), maxDepth = 10, depth = 0) => { | |
if (depth > maxDepth || visited.has(obj)) { | |
return null; | |
} | |
visited.add(obj); | |
for (let key in obj) { | |
if (obj[key] && typeof obj[key] === 'object') { | |
if (obj[key][methodName]) { | |
console.log(`Found ${methodName} at path: ${path}.${key}`); |