Skip to content

Commit 19b7254

Browse files
author
iwakitakuma
committed
FIX
1 parent 42ded6e commit 19b7254

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

customSchemas.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { z } from "zod";
2-
import { pino } from "pino";
2+
import { pino } from 'pino';
33
const DEFAULT_NULL = process.env.DEFAULT_NULL === "true";
44

5+
56
const logger = pino({
6-
level: process.env.LOG_LEVEL || "info",
7+
level: process.env.LOG_LEVEL || 'info',
78
transport: {
8-
target: "pino-pretty",
9+
target: 'pino-pretty',
910
options: {
1011
colorize: true,
1112
levelFirst: true,
@@ -24,9 +25,7 @@ export const flexibleBoolean = z.preprocess(val => {
2425
} catch {
2526
return false;
2627
}
27-
return result in ["true", "t", "1"];
28+
return ["true", "t", "1"].includes(result);
2829
}, z.boolean());
2930

30-
export const flexibleBooleanNullable = DEFAULT_NULL
31-
? flexibleBoolean.nullable().default(null)
32-
: flexibleBoolean.nullable();
31+
export const flexibleBooleanNullable = DEFAULT_NULL ? flexibleBoolean.nullable().default(null) : flexibleBoolean.nullable();

0 commit comments

Comments
 (0)