@@ -297,7 +297,6 @@ function serializeObject(
297
297
value : Document ,
298
298
index : number ,
299
299
checkKeys : boolean ,
300
- depth : number ,
301
300
serializeFunctions : boolean ,
302
301
ignoreUndefined : boolean ,
303
302
path : Set < Document >
@@ -320,7 +319,6 @@ function serializeObject(
320
319
value ,
321
320
checkKeys ,
322
321
index ,
323
- depth + 1 ,
324
322
serializeFunctions ,
325
323
ignoreUndefined ,
326
324
path
@@ -435,7 +433,6 @@ function serializeCode(
435
433
value : Code ,
436
434
index : number ,
437
435
checkKeys = false ,
438
- depth = 0 ,
439
436
serializeFunctions = false ,
440
437
ignoreUndefined = true ,
441
438
path : Set < Document >
@@ -475,7 +472,6 @@ function serializeCode(
475
472
value . scope ,
476
473
checkKeys ,
477
474
index ,
478
- depth + 1 ,
479
475
serializeFunctions ,
480
476
ignoreUndefined ,
481
477
path
@@ -582,7 +578,6 @@ function serializeDBRef(
582
578
key : string ,
583
579
value : DBRef ,
584
580
index : number ,
585
- depth : number ,
586
581
serializeFunctions : boolean ,
587
582
path : Set < Document >
588
583
) {
@@ -606,16 +601,7 @@ function serializeDBRef(
606
601
}
607
602
608
603
output = Object . assign ( output , value . fields ) ;
609
- const endIndex = serializeInto (
610
- buffer ,
611
- output ,
612
- false ,
613
- index ,
614
- depth + 1 ,
615
- serializeFunctions ,
616
- true ,
617
- path
618
- ) ;
604
+ const endIndex = serializeInto ( buffer , output , false , index , serializeFunctions , true , path ) ;
619
605
620
606
// Calculate object size
621
607
const size = endIndex - startIndex ;
@@ -633,7 +619,6 @@ export function serializeInto(
633
619
object : Document ,
634
620
checkKeys : boolean ,
635
621
startingIndex : number ,
636
- depth : number ,
637
622
serializeFunctions : boolean ,
638
623
ignoreUndefined : boolean ,
639
624
path : Set < Document > | null
@@ -714,7 +699,6 @@ export function serializeInto(
714
699
value ,
715
700
index ,
716
701
checkKeys ,
717
- depth ,
718
702
serializeFunctions ,
719
703
ignoreUndefined ,
720
704
path
@@ -741,7 +725,6 @@ export function serializeInto(
741
725
value ,
742
726
index ,
743
727
checkKeys ,
744
- depth ,
745
728
serializeFunctions ,
746
729
ignoreUndefined ,
747
730
path
@@ -751,7 +734,7 @@ export function serializeInto(
751
734
} else if ( value . _bsontype === 'BSONSymbol' ) {
752
735
index = serializeSymbol ( buffer , key , value , index ) ;
753
736
} else if ( value . _bsontype === 'DBRef' ) {
754
- index = serializeDBRef ( buffer , key , value , index , depth , serializeFunctions , path ) ;
737
+ index = serializeDBRef ( buffer , key , value , index , serializeFunctions , path ) ;
755
738
} else if ( value . _bsontype === 'BSONRegExp' ) {
756
739
index = serializeBSONRegExp ( buffer , key , value , index ) ;
757
740
} else if ( value . _bsontype === 'Int32' ) {
@@ -824,7 +807,6 @@ export function serializeInto(
824
807
value ,
825
808
index ,
826
809
checkKeys ,
827
- depth ,
828
810
serializeFunctions ,
829
811
ignoreUndefined ,
830
812
path
@@ -849,7 +831,6 @@ export function serializeInto(
849
831
value ,
850
832
index ,
851
833
checkKeys ,
852
- depth ,
853
834
serializeFunctions ,
854
835
ignoreUndefined ,
855
836
path
@@ -861,7 +842,7 @@ export function serializeInto(
861
842
} else if ( value . _bsontype === 'BSONSymbol' ) {
862
843
index = serializeSymbol ( buffer , key , value , index ) ;
863
844
} else if ( value . _bsontype === 'DBRef' ) {
864
- index = serializeDBRef ( buffer , key , value , index , depth , serializeFunctions , path ) ;
845
+ index = serializeDBRef ( buffer , key , value , index , serializeFunctions , path ) ;
865
846
} else if ( value . _bsontype === 'BSONRegExp' ) {
866
847
index = serializeBSONRegExp ( buffer , key , value , index ) ;
867
848
} else if ( value . _bsontype === 'Int32' ) {
@@ -934,7 +915,6 @@ export function serializeInto(
934
915
value ,
935
916
index ,
936
917
checkKeys ,
937
- depth ,
938
918
serializeFunctions ,
939
919
ignoreUndefined ,
940
920
path
@@ -959,7 +939,6 @@ export function serializeInto(
959
939
value ,
960
940
index ,
961
941
checkKeys ,
962
- depth ,
963
942
serializeFunctions ,
964
943
ignoreUndefined ,
965
944
path
@@ -971,7 +950,7 @@ export function serializeInto(
971
950
} else if ( value . _bsontype === 'BSONSymbol' ) {
972
951
index = serializeSymbol ( buffer , key , value , index ) ;
973
952
} else if ( value . _bsontype === 'DBRef' ) {
974
- index = serializeDBRef ( buffer , key , value , index , depth , serializeFunctions , path ) ;
953
+ index = serializeDBRef ( buffer , key , value , index , serializeFunctions , path ) ;
975
954
} else if ( value . _bsontype === 'BSONRegExp' ) {
976
955
index = serializeBSONRegExp ( buffer , key , value , index ) ;
977
956
} else if ( value . _bsontype === 'Int32' ) {
0 commit comments