/opt/canhelp/node_modules/better-auth/dist/client
NameSizeModeActions
lynx/-0755rm
plugins/-0755rm
react/-0755rm
solid/-0755rm
svelte/-0755rm
vue/-0755rm
broadcast-channel.d.mts7480644editdlrm
broadcast-channel.mjs14350644editdlrm
broadcast-channel.mjs.map30630644editdlrm
config.mjs39280644editdlrm
config.mjs.map77600644editdlrm
fetch-plugins.mjs4340644editdlrm
fetch-plugins.mjs.map8580644editdlrm
focus-manager.d.mts3830644editdlrm
focus-manager.mjs10820644editdlrm
focus-manager.mjs.map21300644editdlrm
index.d.mts44960644editdlrm
index.mjs8000644editdlrm
index.mjs.map15140644editdlrm
online-manager.d.mts4100644editdlrm
online-manager.mjs12130644editdlrm
online-manager.mjs.map23350644editdlrm
parser.d.mts5860644editdlrm
parser.mjs32650644editdlrm
parser.mjs.map66340644editdlrm
path-to-object.d.mts53100644editdlrm
proxy.mjs26030644editdlrm
proxy.mjs.map58120644editdlrm
query.d.mts9330644editdlrm
query.mjs26120644editdlrm
query.mjs.map60700644editdlrm
session-atom.mjs9060644editdlrm
session-atom.mjs.map19440644editdlrm
session-refresh.d.mts11720644editdlrm
session-refresh.mjs44750644editdlrm
session-refresh.mjs.map94440644editdlrm
types.d.mts32060644editdlrm
vanilla.d.mts58340644editdlrm
vanilla.mjs7410644editdlrm
vanilla.mjs.map34150644editdlrm
Edit: /opt/canhelp/node_modules/better-auth/dist/client/proxy.mjs (2603B)
import { isAtom } from "../utils/is-atom.mjs"; //#region src/client/proxy.ts function getMethod(path, knownPathMethods, args) { const method = knownPathMethods[path]; const { fetchOptions, query: _query, ...body } = args || {}; if (method) return method; if (fetchOptions?.method) return fetchOptions.method; if (body && Object.keys(body).length > 0) return "POST"; return "GET"; } function createDynamicPathProxy(routes, client, knownPathMethods, atoms, atomListeners) { function createProxy(path = []) { return new Proxy(function() {}, { get(_, prop) { if (typeof prop !== "string") return; if (prop === "then" || prop === "catch" || prop === "finally") return; const fullPath = [...path, prop]; let current = routes; for (const segment of fullPath) if (current && typeof current === "object" && segment in current) current = current[segment]; else { current = void 0; break; } if (typeof current === "function") return current; if (isAtom(current)) return current; return createProxy(fullPath); }, apply: async (_, __, args) => { const routePath = "/" + path.map((segment) => segment.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)).join("/"); const arg = args[0] || {}; const fetchOptions = args[1] || {}; const { query, fetchOptions: argFetchOptions, ...body } = arg; const options = { ...fetchOptions, ...argFetchOptions }; const method = getMethod(routePath, knownPathMethods, arg); return await client(routePath, { ...options, body: method === "GET" ? void 0 : { ...body, ...options?.body || {} }, query: query || options?.query, method, async onSuccess(context) { await options?.onSuccess?.(context); if (!atomListeners || options.disableSignal) return; /** * We trigger listeners */ const matches = atomListeners.filter((s) => s.matcher(routePath)); if (!matches.length) return; const visited = /* @__PURE__ */ new Set(); for (const match of matches) { const signal = atoms[match.signal]; if (!signal) return; if (visited.has(match.signal)) continue; visited.add(match.signal); /** * To avoid race conditions we set the signal in a setTimeout */ const val = signal.get(); setTimeout(() => { signal.set(!val); }, 10); match.callback?.(routePath); } } }); } }); } return createProxy(); } //#endregion export { createDynamicPathProxy }; //# sourceMappingURL=proxy.mjs.map