mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 00:31:37 +00:00
chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
@@ -14,9 +14,7 @@ export type ScreenRecordPayload = {
|
||||
};
|
||||
|
||||
function asRecord(value: unknown): Record<string, unknown> {
|
||||
return typeof value === "object" && value !== null
|
||||
? (value as Record<string, unknown>)
|
||||
: {};
|
||||
return typeof value === "object" && value !== null ? (value as Record<string, unknown>) : {};
|
||||
}
|
||||
|
||||
function asString(value: unknown): string | undefined {
|
||||
@@ -35,26 +33,18 @@ export function parseScreenRecordPayload(value: unknown): ScreenRecordPayload {
|
||||
base64,
|
||||
durationMs: typeof obj.durationMs === "number" ? obj.durationMs : undefined,
|
||||
fps: typeof obj.fps === "number" ? obj.fps : undefined,
|
||||
screenIndex:
|
||||
typeof obj.screenIndex === "number" ? obj.screenIndex : undefined,
|
||||
screenIndex: typeof obj.screenIndex === "number" ? obj.screenIndex : undefined,
|
||||
hasAudio: typeof obj.hasAudio === "boolean" ? obj.hasAudio : undefined,
|
||||
};
|
||||
}
|
||||
|
||||
export function screenRecordTempPath(opts: {
|
||||
ext: string;
|
||||
tmpDir?: string;
|
||||
id?: string;
|
||||
}) {
|
||||
export function screenRecordTempPath(opts: { ext: string; tmpDir?: string; id?: string }) {
|
||||
const tmpDir = opts.tmpDir ?? os.tmpdir();
|
||||
const id = opts.id ?? randomUUID();
|
||||
const ext = opts.ext.startsWith(".") ? opts.ext : `.${opts.ext}`;
|
||||
return path.join(tmpDir, `clawdbot-screen-record-${id}${ext}`);
|
||||
}
|
||||
|
||||
export async function writeScreenRecordToFile(
|
||||
filePath: string,
|
||||
base64: string,
|
||||
) {
|
||||
export async function writeScreenRecordToFile(filePath: string, base64: string) {
|
||||
return writeBase64ToFile(filePath, base64);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user