File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,13 @@ const FunctionName = (title: string): string => {
1717 return camelCase ( title ) ;
1818} ;
1919
20+ const escapeCodeForTemplateLiteral = ( code : string ) : string => {
21+ return code
22+ . replace ( / \\ / g, '\\\\' ) // Escape backslashes
23+ . replace ( / ` / g, '\\`' ) // Escape backticks
24+ . replace ( / \$ / g, '\\$' ) ; // Escape dollar signs
25+ } ;
26+
2027export const GenerateTypes = async (
2128 automations : Automation [ ]
2229) : Promise < string > => {
@@ -78,7 +85,7 @@ const executeProgramEndpoint = utils.mustEnv(
7885 headers: sdk.JSONValue,
7986 input: types.${ inputTypeName }
8087): Promise<utils.ProgramOutput<types.${ outputTypeName } >> {
81- const code = \`${ automation . config . data . code } \`;
88+ const code = \`${ escapeCodeForTemplateLiteral ( automation . config . data . code ) } \`;
8289 const body = utils.prepareExecuteProgramBody(
8390 headers,
8491 input,
You can’t perform that action at this time.
0 commit comments