@graphql-markdown/logger 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -24,6 +24,27 @@ export declare enum LogLevel {
24
24
  success = "success",
25
25
  warn = "warn"
26
26
  }
27
+ /**
28
+ * Type guard to check if an object has a log method for a given level.
29
+ *
30
+ * @param instance - The object to check
31
+ * @param level - The log level to verify
32
+ * @returns `true` if the instance has a function at the given level, `false` otherwise
33
+ */
34
+ declare const hasLogMethod: (instance: unknown, level: LogLevel | keyof typeof LogLevel) => instance is Record<string, (...args: unknown[]) => unknown>;
35
+ /**
36
+ * Resolve a logger instance from a module export.
37
+ *
38
+ * @remarks
39
+ * Handles various module export patterns:
40
+ * - Direct logger instance: `{ info: () => {}, ... }`
41
+ * - Default export: `{ default: { info: () => {}, ... } }`
42
+ * - Named export: `{ logger: { info: () => {}, ... } }`
43
+ *
44
+ * @param instance - The module export or object to resolve
45
+ * @returns The logger instance if found, or `undefined` if no valid logger is detected (the caller is responsible for falling back to `globalThis.console`)
46
+ */
47
+ declare const resolveLoggerInstance: (instance: unknown) => LoggerType["instance"] | undefined;
27
48
  /**
28
49
  * Instantiate a logger module.
29
50
  * By default, the logger module uses `globalThis.console`
@@ -67,8 +88,8 @@ export declare const log: (message: string, level?: LogLevel | keyof typeof LogL
67
88
  * @internal
68
89
  */
69
90
  export declare const __internal: {
70
- hasLogMethod: (instance: unknown, level: LogLevel | keyof typeof LogLevel) => instance is Record<string, (...args: unknown[]) => unknown>;
71
- resolveLoggerInstance: (instance: unknown) => LoggerType["instance"] | undefined;
91
+ hasLogMethod: typeof hasLogMethod;
92
+ resolveLoggerInstance: typeof resolveLoggerInstance;
72
93
  };
73
94
  /**
74
95
  * @see log
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH,OAAO,KAAK,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AM,YAAY,aACN,OAAO,SACV,QAAQ,GAAG,MAAM,OAAO,QAAQ,KACtC,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAM5D,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,qBAAqB,aACf,OAAO,KAChB,UAAU,CAAC,UAAU,CAAC,GAAG,SA4B3B,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,MAAM,gBAAuB,MAAM,KAAG,OAAO,CAAC,IAAI,CAsC9D,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,GAAG,YACL,MAAM,UAER,QAAQ,GAAG,MAAM,OAAO,QAAQ,KACtC,IAGF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU;;;CAA0C,CAAC;AAElE;;GAEG;AACH,aAAa;eACE,MAAM"}
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "bugs": {
6
6
  "url": "https://github.com/graphql-markdown/graphql-markdown/issues"
7
7
  },
8
- "version": "1.0.7",
8
+ "version": "1.0.8",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
@@ -51,17 +51,17 @@
51
51
  "test:watch": "jest --watch"
52
52
  },
53
53
  "dependencies": {
54
- "@graphql-markdown/types": "^1.13.0"
54
+ "@graphql-markdown/types": ""
55
55
  },
56
56
  "devDependencies": {
57
57
  "@docusaurus/logger": "*",
58
- "@graphql-markdown/tooling-config": "^1.0.0"
58
+ "@graphql-markdown/tooling-config": ""
59
59
  },
60
60
  "directories": {
61
61
  "test": "tests"
62
62
  },
63
63
  "engines": {
64
- "node": ">=20"
64
+ "node": ">=22.12.0"
65
65
  },
66
66
  "publishConfig": {
67
67
  "access": "public"