Skip to content

Commit a49ee35

Browse files
committed
style: fix prettier formatting
1 parent c59f261 commit a49ee35

8 files changed

Lines changed: 52 additions & 27 deletions

File tree

src/utils/core/ApiClient.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,9 @@ export class ApiClient {
656656
const headersForLog = shouldLogHeaders
657657
? allowSensitiveLogs
658658
? this.normalizeHeaders(init.headers)
659-
: this.redactHeaders(this.normalizeHeaders(init.headers))
659+
: this.redactHeaders(
660+
this.normalizeHeaders(init.headers)
661+
)
660662
: undefined;
661663
const requestBodyForLog = allowSensitiveLogs
662664
? rest.body

src/utils/core/SafeSerialization.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ export function safeSerialize(
4141
const sensitiveKeySet = createSensitiveKeySet(sensitiveKeys);
4242
const seen = new WeakSet<object>();
4343

44-
const visit = (input: unknown, depth: number, parentKey?: string): unknown => {
44+
const visit = (
45+
input: unknown,
46+
depth: number,
47+
parentKey?: string
48+
): unknown => {
4549
if (parentKey && isSensitiveKey(parentKey, sensitiveKeySet)) {
4650
return "[REDACTED]";
4751
}

src/utils/core/debug.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ export const measureAsync = async <T>(
112112
const result = await fn();
113113
const durationMs = stopwatch.stop();
114114

115-
/* v8 ignore next */
116-
if (options.logger) {
117-
const logInstance =
118-
options.namespace && options.logger
119-
? options.logger.child(options.namespace)
115+
/* v8 ignore next */
116+
if (options.logger) {
117+
const logInstance =
118+
options.namespace && options.logger
119+
? options.logger.child(options.namespace)
120120
: options.logger;
121121

122122
logInstance.debug(`${label} completed in ${durationMs.toFixed(2)}ms`, {

tests/api-client.test.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,7 @@ test("ApiError.toString() includes sanitized body and ApiError.toJSON() returns
292292
assert.equal(json.statusText, "Not Found");
293293
assert.equal(json.message, "Resource not found.");
294294
assert.equal(json.isTimeout, false);
295-
assert.equal(
296-
(json.body as Record<string, unknown>).token,
297-
"[REDACTED]"
298-
);
295+
assert.equal((json.body as Record<string, unknown>).token, "[REDACTED]");
299296
assert.ok(
300297
typeof json.stack === "string",
301298
"toJSON should include stack trace"
@@ -545,7 +542,10 @@ test("ApiClient sanitizes request and response payloads in logs by default", asy
545542
info: () => {},
546543
};
547544
const fetchImpl = async () =>
548-
jsonResponse({ token: "response-secret", profile: { password: "p4ss" } });
545+
jsonResponse({
546+
token: "response-secret",
547+
profile: { password: "p4ss" },
548+
});
549549
const client = new ApiClient({
550550
baseUrl: "https://api.example.com",
551551
fetchImpl,
@@ -561,7 +561,12 @@ test("ApiClient sanitizes request and response payloads in logs by default", asy
561561
const requestLog = logCalls.find((entry) => "body" in entry)!;
562562
const responseLog = logCalls.find((entry) => "data" in entry)!;
563563
assert.equal(
564-
((requestLog.body as Record<string, unknown>).nested as Record<string, unknown>).apiKey,
564+
(
565+
(requestLog.body as Record<string, unknown>).nested as Record<
566+
string,
567+
unknown
568+
>
569+
).apiKey,
565570
"[REDACTED]"
566571
);
567572
assert.equal(

tests/bytekit-cli.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ describe("bytekit CLI Integration", () => {
6262
openapi: "3.0.0",
6363
components: {
6464
schemas: {
65-
User: { type: "object", properties: { login: { type: "string" } } },
65+
User: {
66+
type: "object",
67+
properties: { login: { type: "string" } },
68+
},
6669
},
6770
},
6871
}),
@@ -86,7 +89,11 @@ describe("bytekit CLI Integration", () => {
8689
const { runCli } = await import(cliUrl);
8790

8891
process.chdir(tempDir);
89-
await runCli(["--ddd", "--domain=TestContext", "--port=OrderRepository"]);
92+
await runCli([
93+
"--ddd",
94+
"--domain=TestContext",
95+
"--port=OrderRepository",
96+
]);
9097

9198
const outbound = await fs.readFile(
9299
path.join(

tests/cli-main.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ describe("CLI main entry", () => {
3838
// ignore exit error
3939
}
4040

41-
expect(spy).toHaveBeenCalledWith(expect.stringContaining("Missing URL"));
41+
expect(spy).toHaveBeenCalledWith(
42+
expect.stringContaining("Missing URL")
43+
);
4244
spy.mockRestore();
4345
exitSpy.mockRestore();
4446
});

tests/new-utils.test.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,17 @@ test("PollingHelper uses the default stopCondition when none is provided", async
219219

220220
test("PollingHelper keeps polling when attempt result is undefined without an error", async () => {
221221
let attempts = 0;
222-
const poller = new PollingHelper(async () => {
223-
attempts++;
224-
return attempts >= 2 ? "ready" : (undefined as unknown as string);
225-
}, {
226-
interval: 1,
227-
maxAttempts: 3,
228-
stopCondition: (result) => result === "ready",
229-
});
222+
const poller = new PollingHelper(
223+
async () => {
224+
attempts++;
225+
return attempts >= 2 ? "ready" : (undefined as unknown as string);
226+
},
227+
{
228+
interval: 1,
229+
maxAttempts: 3,
230+
stopCondition: (result) => result === "ready",
231+
}
232+
);
230233

231234
const result = await poller.start();
232235

tests/security-helpers.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ describe("CLI security helpers", () => {
2222

2323
it("accepts loopback http URLs", () => {
2424
expect(
25-
assertSecureRemoteUrl("http://127.0.0.5:3000/spec.json", "Spec fetch")
26-
.toString()
25+
assertSecureRemoteUrl(
26+
"http://127.0.0.5:3000/spec.json",
27+
"Spec fetch"
28+
).toString()
2729
).toContain("127.0.0.5:3000");
2830
});
2931

@@ -120,7 +122,7 @@ describe("safe serialization helpers", () => {
120122
) as Record<string, unknown>;
121123

122124
expect(
123-
((result.circular as Record<string, unknown>).self as string)
125+
(result.circular as Record<string, unknown>).self as string
124126
).toBe("[Circular]");
125127
expect(result.deepArray).toEqual(["[Array]"]);
126128
expect(result.deepObject).toEqual({ a: "[Object]" });

0 commit comments

Comments
 (0)