Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this[key] = { type, value };
break;
case 'object':
if (value instanceof Date) {
this[key] = { type: 'date-time', value: value.getTime() };
} else {
AppCenterLog.error(logTag, 'CustomProperties: Invalid value type, expected string|number|boolean|Date.');
}
break;
default:
AppCenterLog.error(logTag, 'CustomProperties: Invalid value type, expected string|number|boolean|Date.');
}
} else {
AppCenterLog.error(logTag, 'CustomProperties: Invalid key type, expected string.');
}
return this;
}
.catch((error) => AppCenterLog.error(LOG_TAG, `Could not send error attachments. Error: ${error}`));
});
notifyUserConfirmation(userConfirmation) {
switch (userConfirmation) {
case UserConfirmation.DONT_SEND:
case UserConfirmation.SEND:
case UserConfirmation.ALWAYS_SEND:
AppCenterReactNativeCrashes.notifyWithUserConfirmation(userConfirmation);
break;
default:
AppCenterLog.error(LOG_TAG, 'Crashes.notifyUserConfirmation: Invalid parameter value.');
return;
}
if (userConfirmation !== UserConfirmation.DONT_SEND) {
Helper.sendErrorAttachments();
}
},
clear(key) {
if (typeof key === 'string') {
this[key] = { type: 'clear' };
} else {
AppCenterLog.error(logTag, 'CustomProperties: Invalid key type, expected string.');
}
return this;
}
};
case 'string':
case 'number':
case 'boolean':
this[key] = { type, value };
break;
case 'object':
if (value instanceof Date) {
this[key] = { type: 'date-time', value: value.getTime() };
} else {
AppCenterLog.error(logTag, 'CustomProperties: Invalid value type, expected string|number|boolean|Date.');
}
break;
default:
AppCenterLog.error(logTag, 'CustomProperties: Invalid value type, expected string|number|boolean|Date.');
}
} else {
AppCenterLog.error(logTag, 'CustomProperties: Invalid key type, expected string.');
}
return this;
}
setCustomProperties(properties) {
if (properties instanceof AppCenter.CustomProperties) {
return AppCenterReactNative.setCustomProperties(properties);
}
const type = Object.prototype.toString.apply(properties);
AppCenterLog.error(logTag, `SetCustomProperties: Invalid type, expected CustomProperties but got ${type}.`);
return Promise.resolve(null);
},