Files
klz-cables.com/.pnpm-store/v10/files/03/51b1e48a53224719c5f5f23f83ab41426cdf6116530d85413abb30498222402d2f5dfec5a77b00ea841fa3a4dfa737d4ebb6f45715b20ebc0eefda1f0b4079
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

47 lines
1.3 KiB
Plaintext

import { getCurrentScope } from './currentScopes.js';
import { DEBUG_BUILD } from './debug-build.js';
import { debug, consoleSandbox } from './utils/debug-logger.js';
/** A class object that can instantiate Client objects. */
/**
* Internal function to create a new SDK client instance. The client is
* installed and then bound to the current scope.
*
* @param clientClass The client class to instantiate.
* @param options Options to pass to the client.
*/
function initAndBind(
clientClass,
options,
) {
if (options.debug === true) {
if (DEBUG_BUILD) {
debug.enable();
} else {
// use `console.warn` rather than `debug.warn` since by non-debug bundles have all `debug.x` statements stripped
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');
});
}
}
const scope = getCurrentScope();
scope.update(options.initialScope);
const client = new clientClass(options);
setCurrentClient(client);
client.init();
return client;
}
/**
* Make the given client the current client.
*/
function setCurrentClient(client) {
getCurrentScope().setClient(client);
}
export { initAndBind, setCurrentClient };
//# sourceMappingURL=sdk.js.map