Skip to content

Commit

Permalink
Remove Slash (#997)
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusgr authored Jan 28, 2025
1 parent 8d63cdb commit fd04204
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion shopify/utils/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ export const toProduct = (
})) ?? [DEFAULT_IMAGE],
video: media.nodes.filter((media) => media.mediaContentType === "VIDEO")
.map((video) => {
const contentUrl = 'sources' in video ? video.sources?.[0]?.url : undefined;
const contentUrl = "sources" in video
? video.sources?.[0]?.url
: undefined;
return {
"@type": "VideoObject",
contentUrl,
Expand Down
3 changes: 2 additions & 1 deletion utils/normalize.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export const removeScriptChars = (str: string): string => {
const removedPlus = str.replace(/\+/g, "").replaceAll(" ", "");
const removedBrackets = removedPlus.replace(/[\[\]{}()<>]/g, "");
const normalized = removedBrackets.normalize("NFD").replace(
const removedSlash = removedBrackets.replace(/[\/\\]/g, "");
const normalized = removedSlash.normalize("NFD").replace(
/[\u0300-\u036f]/g,
"",
);
Expand Down
6 changes: 3 additions & 3 deletions vtex/utils/segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ const serialize = ({
priceTables,
regionId,
utm_campaign: utm_campaign &&
removeNonLatin1Chars(utm_campaign).replace(/[\[\]{}()<>]/g, ""),
removeNonLatin1Chars(utm_campaign).replace(/[\/\[\]{}()<>]/g, ""),
utm_source: utm_source &&
removeNonLatin1Chars(utm_source).replace(/[\[\]{}()<>]/g, ""),
removeNonLatin1Chars(utm_source).replace(/[\/\[\]{}()<>]/g, ""),
utm_medium: utm_medium &&
removeNonLatin1Chars(utm_medium).replace(/[\[\]{}()<>]/g, ""),
removeNonLatin1Chars(utm_medium).replace(/[\/\[\]{}()<>]/g, ""),
utmi_campaign: utmi_campaign && removeNonLatin1Chars(utmi_campaign),
utmi_page: utmi_page && removeNonLatin1Chars(utmi_page),
utmi_part: utmi_part && removeNonLatin1Chars(utmi_part),
Expand Down

0 comments on commit fd04204

Please sign in to comment.