Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
logPresentOffer(object) {
if (!isObject(object)) {
throw new Error(
'firebase.analytics().logPresentOffer(*): The supplied arg must be an object of key/values.',
);
}
validateCompound(object, 'value', 'currency', 'firebase.analytics().logPresentOffer(*):');
return this.logEvent(
'present_offer',
validateStruct(object, structs.PresentOffer, 'firebase.analytics().logPresentOffer(*):'),
);
}
logViewItem(object) {
if (!isObject(object)) {
throw new Error(
'firebase.analytics().logViewItem(*): The supplied arg must be an object of key/values.',
);
}
validateCompound(object, 'value', 'currency', 'firebase.analytics().logViewItem(*):');
return this.logEvent(
'view_item',
validateStruct(object, structs.ViewItem, 'firebase.analytics().logViewItem(*):'),
);
}
logRemoveFromCart(object) {
if (!isObject(object)) {
throw new Error(
'firebase.analytics().logRemoveFromCart(*): The supplied arg must be an object of key/values.',
);
}
validateCompound(object, 'value', 'currency', 'firebase.analytics().logRemoveFromCart(*):');
return this.logEvent(
'remove_from_cart',
validateStruct(object, structs.RemoveFromCart, 'firebase.analytics().logRemoveFromCart(*):'),
);
}
logBeginCheckout(object = {}) {
validateCompound(object, 'value', 'currency', 'firebase.analytics().logBeginCheckout(*):');
return this.logEvent(
'begin_checkout',
validateStruct(object, structs.BeginCheckout, 'firebase.analytics().logBeginCheckout(*):'),
);
}
logEcommercePurchase(object = {}) {
validateCompound(object, 'value', 'currency', 'firebase.analytics().logEcommercePurchase(*):');
return this.logEvent(
'ecommerce_purchase',
validateStruct(
object,
structs.EcommercePurchase,
'firebase.analytics().logEcommercePurchase(*):',
),
);
}
logGenerateLead(object = {}) {
validateCompound(object, 'value', 'currency', 'firebase.analytics().logGenerateLead(*):');
return this.logEvent(
'generate_lead',
validateStruct(object, structs.GenerateLead, 'firebase.analytics().logGenerateLead(*):'),
);
}
logAddToWishlist(object) {
if (!isObject(object)) {
throw new Error(
'firebase.analytics().logAddToWishlist(*): The supplied arg must be an object of key/values.',
);
}
validateCompound(object, 'value', 'currency', 'firebase.analytics().logAddToWishlist(*):');
return this.logEvent(
'add_to_wishlist',
validateStruct(object, structs.AddToWishlist, 'firebase.analytics().logAddToWishlist(*):'),
);
}
logPurchaseRefund(object = {}) {
validateCompound(object, 'value', 'currency', 'firebase.analytics().logPresentOffer(*):');
return this.logEvent(
'purchase_refund',
validateStruct(object, structs.PurchaseRefund, 'firebase.analytics().logPurchaseRefund(*):'),
);
}
logAddToCart(object) {
if (!isObject(object)) {
throw new Error(
'firebase.analytics().logAddToCart(*): The supplied arg must be an object of key/values.',
);
}
validateCompound(object, 'value', 'currency', 'firebase.analytics().logAddToCart(*):');
return this.logEvent(
'add_to_cart',
validateStruct(object, structs.AddToCart, 'firebase.analytics().logAddToCart(*):'),
);
}