Skip to content

Commit 0675833

Browse files
committed
Clarify return value of buildJsonDumpObject()
1 parent 10aec7b commit 0675833

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎apps/api-extractor/src/collector/MessageRouter.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,12 @@ export class MessageRouter {
245245
/**
246246
* Recursively collects the primitive members (numbers, strings, arrays, etc) into an object that
247247
* is JSON serializable. This is used by the "--diagnostics" feature to dump the state of configuration objects.
248+
*
249+
* @returns a JSON serializable object (possibly including `null` values)
250+
* or `undefined` if the input cannot be represented as JSON
248251
*/
249252
// tslint:disable-next-line:no-any
250-
public static buildJsonDumpObject(input: any): any {
253+
public static buildJsonDumpObject(input: any): any | undefined {
251254
if (input === null || input === undefined) {
252255
// tslint:disable-next-line:no-null-keyword
253256
return null; // JSON uses null instead of undefined

0 commit comments

Comments
 (0)