File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -829,7 +829,6 @@ export default class Options {
829
829
830
830
init ( this , options , this ) ;
831
831
init ( options , options , this ) ;
832
- this . _init . push ( options ) ;
833
832
834
833
// This is way much faster than cloning ^_^
835
834
Object . freeze ( options ) ;
@@ -846,6 +845,8 @@ export default class Options {
846
845
this . _merging = true ;
847
846
848
847
try {
848
+ let push = false ;
849
+
849
850
for ( const key in options ) {
850
851
// `got.extend()` options
851
852
if ( key === 'mutableDefaults' || key === 'handlers' ) {
@@ -863,6 +864,12 @@ export default class Options {
863
864
864
865
// @ts -expect-error Type 'unknown' is not assignable to type 'never'.
865
866
this [ key as keyof Options ] = options [ key as keyof Options ] ;
867
+
868
+ push = true ;
869
+ }
870
+
871
+ if ( push ) {
872
+ this . _init . push ( options ) ;
866
873
}
867
874
} finally {
868
875
this . _merging = false ;
You can’t perform that action at this time.
0 commit comments