@@ -153,7 +153,7 @@ function cursorNext(
153153 return async function ( ) : Promise < Document | null > {
154154 const result = await original ( ) ;
155155 if ( result ) {
156- replaceWithCustomInspect ( result ) ;
156+ addCustomInspect ( result ) ;
157157 }
158158 return result ;
159159 } ;
@@ -167,7 +167,7 @@ function cursorReadBufferedDocuments(
167167 return function ( number ?: number ) : Document [ ] {
168168 const results = original ( number ) ;
169169
170- replaceWithCustomInspect ( results ) ;
170+ addCustomInspect ( results ) ;
171171
172172 return results ;
173173 } ;
@@ -179,7 +179,7 @@ function cursorToArray(
179179 return async function ( ) : Promise < Document [ ] > {
180180 const results = await original ( ) ;
181181
182- replaceWithCustomInspect ( results ) ;
182+ addCustomInspect ( results ) ;
183183
184184 return results ;
185185 } ;
@@ -199,7 +199,7 @@ function bsonMethod<
199199 // @ts -ignore The returntype already contains a promise
200200 ReturnType < Required < ServiceProvider > [ K ] > {
201201 const result = await ( this . _sp [ key ] as any ) ( ...args ) ;
202- replaceWithCustomInspect ( result ) ;
202+ addCustomInspect ( result ) ;
203203 return result ;
204204 } ;
205205}
@@ -242,16 +242,16 @@ function customDocumentInspect(
242242 return result ;
243243}
244244
245- function replaceWithCustomInspect ( obj : any ) {
245+ function addCustomInspect ( obj : any ) {
246246 if ( Array . isArray ( obj ) ) {
247247 ( obj as any ) [ customInspectSymbol ] = customDocumentInspect ;
248248 for ( const item of obj ) {
249- replaceWithCustomInspect ( item ) ;
249+ addCustomInspect ( item ) ;
250250 }
251251 } else if ( obj && typeof obj === 'object' && obj !== null ) {
252252 obj [ customInspectSymbol ] = customDocumentInspect ;
253253 for ( const value of Object . values ( obj ) ) {
254- replaceWithCustomInspect ( value ) ;
254+ addCustomInspect ( value ) ;
255255 }
256256 }
257257}
0 commit comments