@scaleway/use-analytics
Version:
A small hook to handle events analytics
20 lines (19 loc) • 426 B
JavaScript
;
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const normalizeId = (id) => {
if (id === null || id === void 0) {
return void 0;
}
if (typeof id === "string") {
try {
const parsed = JSON.parse(id);
if (typeof parsed === "string") {
return parsed;
}
} catch {
}
return id;
}
return String(id);
};
exports.normalizeId = normalizeId;