From b4efe47f2acfebd48a9811c4b82e742487f744f7 Mon Sep 17 00:00:00 2001 From: Matheus Peviani Vellone Date: Wed, 3 May 2023 14:35:40 -0300 Subject: [PATCH] add test for #1704 --- test/types/pino.test-d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/types/pino.test-d.ts b/test/types/pino.test-d.ts index dbfd0852d..6ae04f542 100644 --- a/test/types/pino.test-d.ts +++ b/test/types/pino.test-d.ts @@ -329,3 +329,15 @@ pino({ crlf: true, }); +const customLevels = { foo: 99 }; + +const customLevelLogger = pino({ customLevels }); + +type CustomLevelLogger = typeof customLevelLogger +type CustomLevelLoggerLevels = pino.Level | keyof typeof customLevels + +const fn = (logger: Pick) => {} + +const customLevelChildLogger = customLevelLogger.child({ name: "child" }) + +fn(customLevelChildLogger); // missing foo typing