( command: Document, explain: Explain )
| 105 | * @param options - the options containing the explain verbosity |
| 106 | */ |
| 107 | export function decorateWithExplain( |
| 108 | command: Document, |
| 109 | explain: Explain |
| 110 | ): { |
| 111 | explain: Document; |
| 112 | verbosity: ExplainVerbosity; |
| 113 | maxTimeMS?: number; |
| 114 | } { |
| 115 | type ExplainCommand = ReturnType<typeof decorateWithExplain>; |
| 116 | const { verbosity, maxTimeMS } = explain; |
| 117 | const baseCommand: ExplainCommand = { explain: command, verbosity }; |
| 118 | |
| 119 | if (typeof maxTimeMS === class="st">'number') { |
| 120 | baseCommand.maxTimeMS = maxTimeMS; |
| 121 | } |
| 122 | |
| 123 | return baseCommand; |
| 124 | } |
no outgoing calls
no test coverage detected