pinojs / pino-pretty

🌲Basic prettifier for Pino log lines
MIT License
1.27k stars 150 forks source link

Add type definition for the 'sync' option #298

Closed OnkelTem closed 2 years ago

OnkelTem commented 2 years ago

Adding types for #297

cc @mcollina :)

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 1737798743


Totals Coverage Status
Change from base Build 1724803968: 0.0%
Covered Lines: 350
Relevant Lines: 350

💛 - Coveralls
OnkelTem commented 2 years ago

Matteo, following test/types/pino-pretty.test-d.ts style, it would be just:

diff --git a/test/types/pino-pretty.test-d.ts b/test/types/pino-pretty.test-d.ts
index 72bdd8c..90a3405 100644
--- a/test/types/pino-pretty.test-d.ts
+++ b/test/types/pino-pretty.test-d.ts
@@ -27,7 +27,8 @@ const options: PinoPretty.PrettyOptions = {
     key: (value) => {
       return value.toString().toUpperCase();
     }
-  }
+  },
+  sync: false,
 };

 const options2: PrettyOptions = {
@@ -49,7 +50,8 @@ const options2: PrettyOptions = {
     key: (value) => {
       return value.toString().toUpperCase();
     }
-  }
+  },
+  sync: false,
 };

 expectType<PrettyStream>(pretty(options));

Did I get it right and that's what you meant?

mcollina commented 2 years ago

Yes, exactly

OnkelTem commented 2 years ago

Hi! Have I done it already? Or I missed something? Not quite sure what I'm looking at:

image