This commit is contained in:
MarSeventh
2024-07-19 23:26:06 +08:00
commit 4e0c55d1f9
1401 changed files with 69819 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
/**
* Checks if a given value is a valid measurement value.
*/
function isMeasurementValue(value) {
return typeof value === 'number' && isFinite(value);
}
/**
* Helper function to start child on transactions. This function will make sure that the transaction will
* use the start timestamp of the created child span if it is earlier than the transactions actual
* start timestamp.
*
* Note: this will not be possible anymore in v8,
* unless we do some special handling for browser here...
*/
function _startChild(transaction, { startTimestamp, ...ctx }) {
// eslint-disable-next-line deprecation/deprecation
if (startTimestamp && transaction.startTimestamp > startTimestamp) {
// eslint-disable-next-line deprecation/deprecation
transaction.startTimestamp = startTimestamp;
}
// eslint-disable-next-line deprecation/deprecation
return transaction.startChild({
startTimestamp,
...ctx,
});
}
export { _startChild, isMeasurementValue };
//# sourceMappingURL=utils.js.map