openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
24 lines (23 loc) • 648 B
JavaScript
import { g as readStringValue } from "./string-coerce-CCIiB4H7.mjs";
import "./string-coerce-runtime-BwAZZDf5.mjs";
//#region extensions/google/oauth-token-shared.ts
function parseGoogleOauthApiKey(e) {
try {
const t = JSON.parse(e);
return {
token: readStringValue(t.token),
projectId: readStringValue(t.projectId)
};
} catch {
return null;
}
}
function formatGoogleOauthApiKey(e) {
if (e.type !== "oauth" || typeof e.access !== "string" || !e.access.trim()) return "";
return JSON.stringify({
token: e.access,
projectId: e.projectId
});
}
//#endregion
export { parseGoogleOauthApiKey as n, formatGoogleOauthApiKey as t };