Skip to content

Commit 97f5b20

Browse files
committed
fix indentation
1 parent b3be658 commit 97f5b20

1 file changed

Lines changed: 16 additions & 19 deletions

File tree

src/lib/analytics.ts

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -240,27 +240,24 @@ type trackEventProps = {
240240

241241
const trackEvent = ({ object, verb, attributes }: trackEventProps) => {
242242
try {
243-
244-
245-
const event = `${object}${_SEP_}${verb}`
246-
Object.keys(attributes).map(attr => {
247-
const value = attributes[attr];
248-
if (typeof value !== "number") {
249-
attributes[attr] = value.toLowerCase();
243+
const event = `${object}${_SEP_}${verb}`
244+
Object.keys(attributes).map(attr => {
245+
const value = attributes[attr];
246+
if (typeof value !== "number") {
247+
attributes[attr] = value.toLowerCase();
248+
}
249+
return attr;
250+
});
251+
252+
// Remove http and www from links
253+
if (Object.keys(attributes).some((attr) => attr == Attributes.LINK)) {
254+
attributes[Attributes.LINK] = attributes[Attributes.LINK].replace(/(https*:\/\/[www.]*)/, '')
250255
}
251-
return attr;
252-
});
253-
254-
// Remove http and www from links
255-
256-
if (Object.keys(attributes).some((attr) => attr == Attributes.LINK)) {
257-
attributes[Attributes.LINK] = attributes[Attributes.LINK].replace(/(https*:\/\/[www.]*)/, '')
258-
}
259256

260-
if (isDevelopment()) {
261-
console.log("analytics", event, attributes)
262-
return;
263-
}
257+
if (isDevelopment()) {
258+
console.log("analytics", event, attributes)
259+
return;
260+
}
264261

265262
track(event, attributes);
266263
} catch (e) {

0 commit comments

Comments
 (0)