Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (prepared.dist === undefined && dist !== undefined) {
prepared.dist = dist;
}
if (prepared.message) {
prepared.message = truncate(prepared.message, maxValueLength);
}
const exception = prepared.exception && prepared.exception.values && prepared.exception.values[0];
if (exception && exception.value) {
exception.value = truncate(exception.value, maxValueLength);
}
const request = prepared.request;
if (request && request.url) {
request.url = truncate(request.url, maxValueLength);
}
if (prepared.event_id === undefined) {
prepared.event_id = uuid4();
}
this._addIntegrations(prepared.sdk);
// We prepare the result here with a resolved Event.
let result = SyncPromise.resolve(prepared);
// This should be the last thing called, since we want that
// {@link Hub.addEventProcessor} gets the finished prepared event.
if (scope) {
// In case we have a hub we reassign it.
result = scope.applyToEvent(prepared, hint);
}
if (prepared.release === undefined && release !== undefined) {
prepared.release = release;
}
if (prepared.dist === undefined && dist !== undefined) {
prepared.dist = dist;
}
if (prepared.message) {
prepared.message = truncate(prepared.message, maxValueLength);
}
const exception = prepared.exception && prepared.exception.values && prepared.exception.values[0];
if (exception && exception.value) {
exception.value = truncate(exception.value, maxValueLength);
}
const request = prepared.request;
if (request && request.url) {
request.url = truncate(request.url, maxValueLength);
}
if (prepared.event_id === undefined) {
prepared.event_id = uuid4();
}
this._addIntegrations(prepared.sdk);
// We prepare the result here with a resolved Event.
let result = SyncPromise.resolve(prepared);
const { environment, release, dist, maxValueLength = 250 } = this.getOptions();
const prepared: Event = { ...event };
if (prepared.environment === undefined && environment !== undefined) {
prepared.environment = environment;
}
if (prepared.release === undefined && release !== undefined) {
prepared.release = release;
}
if (prepared.dist === undefined && dist !== undefined) {
prepared.dist = dist;
}
if (prepared.message) {
prepared.message = truncate(prepared.message, maxValueLength);
}
const exception = prepared.exception && prepared.exception.values && prepared.exception.values[0];
if (exception && exception.value) {
exception.value = truncate(exception.value, maxValueLength);
}
const request = prepared.request;
if (request && request.url) {
request.url = truncate(request.url, maxValueLength);
}
if (prepared.event_id === undefined) {
prepared.event_id = uuid4();
}