Files
NapCatQQ/packages/napcat-onebot/action/extends/qzone-public/http-params.ts
T
TanTan f954252a34
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
Release Tag / validate-version (push) Waiting to run
NapCatQQ source snapshot
2026-11-13 09:01:47 +08:00

13 lines
542 B
TypeScript

/** Decode individual GET / form values before applying the public Qzone action contract. */
export function decodeQzonePublicHttpParameters (parameters: unknown): Record<string, unknown> {
if (parameters === null || typeof parameters !== 'object' || Array.isArray(parameters)) return {};
return Object.fromEntries(Object.entries(parameters).map(([key, value]) => {
if (typeof value !== 'string') return [key, value];
try {
return [key, JSON.parse(value) as unknown];
} catch {
return [key, value];
}
}));
}