Skip to content

Commit

Permalink
remove stringify
Browse files Browse the repository at this point in the history
  • Loading branch information
flashdesignory committed Aug 2, 2024
1 parent da2b218 commit ad67295
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/third-parties/google-analytics/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"key": "gtag"
},
{
"code": "window[{{l}}]=window[{{l}}]||[];window['gtag-{{l}}']=function (){window[{{l}}].push(arguments);};window['gtag-{{l}}']('js',new Date());window['gtag-{{l}}']('config','{{id}}')",
"code": "window['{{l}}']=window['{{l}}']||[];window['gtag-{{l}}']=function (){window['{{l}}'].push(arguments);};window['gtag-{{l}}']('js',new Date());window['gtag-{{l}}']('config','{{id}}')",
"params": ["id"],
"optionalParams": {
"l": "dataLayer"
Expand Down
4 changes: 1 addition & 3 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ export function formatCode(
) {
return code.replace(/{{(.*?)}}/g, (match) => {
const name = match.split(/{{|}}/).filter(Boolean)[0];
return JSON.stringify(
args?.[name] !== undefined ? args?.[name] : optionalParams?.[name],
);
return args?.[name] !== undefined ? args?.[name] : optionalParams?.[name];
});
}

Expand Down

0 comments on commit ad67295

Please sign in to comment.