mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 07:27:40 +00:00
chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
@@ -24,9 +24,7 @@ const _decodeWsData = (data: unknown): string => {
|
||||
if (Array.isArray(data)) return Buffer.concat(data).toString("utf-8");
|
||||
if (data instanceof ArrayBuffer) return Buffer.from(data).toString("utf-8");
|
||||
if (ArrayBuffer.isView(data)) {
|
||||
return Buffer.from(data.buffer, data.byteOffset, data.byteLength).toString(
|
||||
"utf-8",
|
||||
);
|
||||
return Buffer.from(data.buffer, data.byteOffset, data.byteLength).toString("utf-8");
|
||||
}
|
||||
return "";
|
||||
};
|
||||
@@ -122,10 +120,7 @@ describe("gateway server node/bridge", () => {
|
||||
remoteIp: "10.0.0.11",
|
||||
});
|
||||
expect(pairedNode?.caps?.slice().sort()).toEqual(["camera", "canvas"]);
|
||||
expect(pairedNode?.commands?.slice().sort()).toEqual([
|
||||
"canvas.eval",
|
||||
"canvas.snapshot",
|
||||
]);
|
||||
expect(pairedNode?.commands?.slice().sort()).toEqual(["canvas.eval", "canvas.snapshot"]);
|
||||
|
||||
const unpairedNode = nodes.find((n) => n.nodeId === "u1");
|
||||
expect(unpairedNode).toMatchObject({
|
||||
@@ -263,9 +258,7 @@ describe("gateway server node/bridge", () => {
|
||||
});
|
||||
|
||||
expect(res?.ok).toBe(true);
|
||||
const payload = JSON.parse(
|
||||
String((res as { payloadJSON?: string }).payloadJSON ?? "{}"),
|
||||
) as {
|
||||
const payload = JSON.parse(String((res as { payloadJSON?: string }).payloadJSON ?? "{}")) as {
|
||||
sessionKey?: string;
|
||||
sessionId?: string;
|
||||
messages?: unknown[];
|
||||
@@ -312,9 +305,7 @@ describe("gateway server node/bridge", () => {
|
||||
});
|
||||
|
||||
expect(res?.ok).toBe(true);
|
||||
const payload = JSON.parse(
|
||||
String((res as { payloadJSON?: string }).payloadJSON ?? "{}"),
|
||||
) as {
|
||||
const payload = JSON.parse(String((res as { payloadJSON?: string }).payloadJSON ?? "{}")) as {
|
||||
sessions?: unknown[];
|
||||
count?: number;
|
||||
path?: string;
|
||||
@@ -465,9 +456,7 @@ describe("gateway server node/bridge", () => {
|
||||
const call = spy.mock.calls.at(-1)?.[0] as
|
||||
| { images?: Array<{ type: string; data: string; mimeType: string }> }
|
||||
| undefined;
|
||||
expect(call?.images).toEqual([
|
||||
{ type: "image", data: pngB64, mimeType: "image/png" },
|
||||
]);
|
||||
expect(call?.images).toEqual([{ type: "image", data: pngB64, mimeType: "image/png" }]);
|
||||
|
||||
await server.close();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user