Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
logLevelUp(object) {
if (!isObject(object)) {
throw new Error(
'firebase.analytics().logLevelUp(*): The supplied arg must be an object of key/values.',
);
}
return this.logEvent(
'level_up',
validateStruct(object, structs.LevelUp, 'firebase.analytics().logLevelUp(*):'),
);
}
logPurchaseRefund(object = {}) {
validateCompound(object, 'value', 'currency', 'firebase.analytics().logPresentOffer(*):');
return this.logEvent(
'purchase_refund',
validateStruct(object, structs.PurchaseRefund, 'firebase.analytics().logPurchaseRefund(*):'),
);
}
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(*):'),
);
}
logBeginCheckout(object = {}) {
validateCompound(object, 'value', 'currency', 'firebase.analytics().logBeginCheckout(*):');
return this.logEvent(
'begin_checkout',
validateStruct(object, structs.BeginCheckout, 'firebase.analytics().logBeginCheckout(*):'),
);
}
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(*):'),
);
}
logLevelEnd(object) {
if (!isObject(object)) {
throw new Error(
'firebase.analytics().logLevelEnd(*): The supplied arg must be an object of key/values.',
);
}
return this.logEvent(
'level_end',
validateStruct(object, structs.LevelEnd, 'firebase.analytics().logLevelEnd(*):'),
);
}
logSignUp(object) {
if (!isObject(object)) {
throw new Error(
'firebase.analytics().logSignUp(*): The supplied arg must be an object of key/values.',
);
}
return this.logEvent(
'sign_up',
validateStruct(object, structs.SignUp, 'firebase.analytics().logSignUp(*):'),
);
}
logSearch(object) {
if (!isObject(object)) {
throw new Error(
'firebase.analytics().logSearch(*): The supplied arg must be an object of key/values.',
);
}
return this.logEvent(
'search',
validateStruct(object, structs.Search, 'firebase.analytics().logSearch(*):'),
);
}
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(*):'),
);
}