mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-26 08:56:40 -05:00
26 lines
605 B
TypeScript
26 lines
605 B
TypeScript
import type { ElectronClientOptions } from "./types/client";
|
|
|
|
export function isProcessType(type: typeof process.type) {
|
|
return typeof process !== "undefined" && process.type === type;
|
|
}
|
|
|
|
export function parseProtocolScheme(
|
|
protocolOption: ElectronClientOptions["protocol"],
|
|
) {
|
|
if (typeof protocolOption === "string") {
|
|
return {
|
|
scheme: protocolOption,
|
|
privileges: {},
|
|
};
|
|
}
|
|
|
|
return {
|
|
scheme: protocolOption.scheme,
|
|
privileges: protocolOption.privileges || {},
|
|
};
|
|
}
|
|
|
|
export function getChannelPrefixWithDelimiter(ns: string = "better-auth") {
|
|
return ns.length > 0 ? ns + ":" : ns;
|
|
}
|