To return the result as a string, you can use JSON.stringify() to convert the object to a string. Here’s an example: export default defineComponent({ async run({ steps, $ }) { const input = `**first name**: Dylan **last name**: Pierce **company**: Pipedream`; const lines = input.split("\n"); const result = {}; lines.forEach((line) => { const [key, value] = line.split("**: ").map((item) => item.replace("**", "").trim()); result[key] = value; }); return JSON.stringify(result); }, }); This code will return the extracted information as a string: ```
on “{"first name":"Dylan","last name":"Pierce","company":"Pipedream"}”
To remove the quotes, colons, and curly braces from the string {"":"testcompanyname"}, you can use the replace() function with a regular expression. Here’s an example: export default defineComponent({ async run({ steps, $ }) { const input = '{"":"testcompanyname"}'; const cleanedString = input.replace(/[":{}]/g, ''); return cleanedString; }, }); This code will return the cleaned string: testcompanyname.