mirror of
https://github.com/MarSeventh/CloudFlare-ImgBed.git
synced 2026-04-28 08:04:43 +00:00
init
This commit is contained in:
39
node_modules/@sentry-internal/tracing/cjs/browser/web-vitals/lib/observe.js
generated
vendored
Normal file
39
node_modules/@sentry-internal/tracing/cjs/browser/web-vitals/lib/observe.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
/**
|
||||
* Takes a performance entry type and a callback function, and creates a
|
||||
* `PerformanceObserver` instance that will observe the specified entry type
|
||||
* with buffering enabled and call the callback _for each entry_.
|
||||
*
|
||||
* This function also feature-detects entry support and wraps the logic in a
|
||||
* try/catch to avoid errors in unsupporting browsers.
|
||||
*/
|
||||
const observe = (
|
||||
type,
|
||||
callback,
|
||||
opts,
|
||||
) => {
|
||||
try {
|
||||
if (PerformanceObserver.supportedEntryTypes.includes(type)) {
|
||||
const po = new PerformanceObserver(list => {
|
||||
callback(list.getEntries() );
|
||||
});
|
||||
po.observe(
|
||||
Object.assign(
|
||||
{
|
||||
type,
|
||||
buffered: true,
|
||||
},
|
||||
opts || {},
|
||||
) ,
|
||||
);
|
||||
return po;
|
||||
}
|
||||
} catch (e) {
|
||||
// Do nothing.
|
||||
}
|
||||
return;
|
||||
};
|
||||
|
||||
exports.observe = observe;
|
||||
//# sourceMappingURL=observe.js.map
|
||||
Reference in New Issue
Block a user