init
This commit is contained in:
48
node_modules/@capacitor/synapse/dist/synapse.mjs
generated
vendored
Normal file
48
node_modules/@capacitor/synapse/dist/synapse.mjs
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
function s(t) {
|
||||
t.CapacitorUtils.Synapse = new Proxy(
|
||||
{},
|
||||
{
|
||||
get(e, n) {
|
||||
return new Proxy({}, {
|
||||
get(w, o) {
|
||||
return (c, p, r) => {
|
||||
const i = t.Capacitor.Plugins[n];
|
||||
if (i === void 0) {
|
||||
r(new Error(`Capacitor plugin ${n} not found`));
|
||||
return;
|
||||
}
|
||||
if (typeof i[o] != "function") {
|
||||
r(new Error(`Method ${o} not found in Capacitor plugin ${n}`));
|
||||
return;
|
||||
}
|
||||
(async () => {
|
||||
try {
|
||||
const a = await i[o](c);
|
||||
p(a);
|
||||
} catch (a) {
|
||||
r(a);
|
||||
}
|
||||
})();
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
function u(t) {
|
||||
t.CapacitorUtils.Synapse = new Proxy(
|
||||
{},
|
||||
{
|
||||
get(e, n) {
|
||||
return t.cordova.plugins[n];
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
function f(t = !1) {
|
||||
typeof window > "u" || (window.CapacitorUtils = window.CapacitorUtils || {}, window.Capacitor !== void 0 && !t ? s(window) : window.cordova !== void 0 && u(window));
|
||||
}
|
||||
export {
|
||||
f as exposeSynapse
|
||||
};
|
||||
Reference in New Issue
Block a user