@@ -57,14 +57,14 @@ export default class Stack {
5757 return false
5858 }
5959 } ;
60- this . config = Object . assign ( { } , config )
60+ this . config = Utils . mergeDeep ( { } , config )
6161
6262 if ( stack_arguments [ 0 ] . region && stack_arguments [ 0 ] . region !== undefined && stack_arguments [ 0 ] . region !== "us" ) {
6363 this . config [ 'host' ] = stack_arguments [ 0 ] . region + "-" + "cdn.contentstack.com" ;
6464 }
6565
6666 if ( stack_arguments [ 0 ] . fetchOptions && stack_arguments [ 0 ] . fetchOptions !== undefined ) {
67- this . fetchOptions = Object . assign ( this . fetchOptions , stack_arguments [ 0 ] . fetchOptions ) ;
67+ this . fetchOptions = Utils . mergeDeep ( this . fetchOptions , stack_arguments [ 0 ] . fetchOptions ) ;
6868 }
6969
7070 this . cachePolicy = CacheProvider . policies . IGNORE_CACHE ;
@@ -107,7 +107,7 @@ export default class Stack {
107107 if ( typeof stack_arguments [ 3 ] === "string" && stack_arguments [ 3 ] !== undefined && stack_arguments [ 3 ] !== "us" ) {
108108 this . config [ 'host' ] = stack_arguments [ 3 ] + "-" + "cdn.contentstack.com" ;
109109 } else if ( typeof stack_arguments [ 3 ] === 'object' ) {
110- this . fetchOptions = Object . assign ( this . fetchOptions , stack_arguments [ 3 ] ) ;
110+ this . fetchOptions = Utils . mergeDeep ( this . fetchOptions , stack_arguments [ 3 ] ) ;
111111 }
112112 }
113113 return this ;
@@ -126,11 +126,11 @@ export default class Stack {
126126 if ( typeof stack_arguments [ 3 ] === "string" && stack_arguments [ 3 ] !== undefined && stack_arguments [ 3 ] !== "us" ) {
127127 this . config [ 'host' ] = stack_arguments [ 3 ] + "-" + "cdn.contentstack.com" ;
128128 } else if ( typeof stack_arguments [ 3 ] === 'object' ) {
129- this . fetchOptions = Object . assign ( this . fetchOptions , stack_arguments [ 3 ] ) ;
129+ this . fetchOptions = Utils . mergeDeep ( this . fetchOptions , stack_arguments [ 3 ] ) ;
130130 }
131131 }
132132 if ( stack_arguments [ 4 ] && typeof stack_arguments [ 4 ] === 'object' ) {
133- this . fetchOptions = Object . assign ( this . fetchOptions , stack_arguments [ 4 ] ) ;
133+ this . fetchOptions = Utils . mergeDeep ( this . fetchOptions , stack_arguments [ 4 ] ) ;
134134 }
135135 return this ;
136136 default :
@@ -353,7 +353,7 @@ export default class Stack {
353353 environment : this . environment
354354 }
355355 } ;
356- var options = Object . assign ( { } , this . fetchOptions , fetchOptions ) ;
356+ var options = Utils . mergeDeep ( { } , this . fetchOptions , fetchOptions ) ;
357357 return Request ( result , options ) ;
358358 }
359359
@@ -497,7 +497,7 @@ export default class Stack {
497497
498498 sync ( params , fetchOptions ) {
499499 this . _query = { } ;
500- this . _query = Object . assign ( this . _query , params ) ;
500+ this . _query = Utils . mergeDeep ( this . _query , params ) ;
501501 this . requestParams = {
502502 method : 'POST' ,
503503 headers : this . headers ,
@@ -507,7 +507,7 @@ export default class Stack {
507507 query : this . _query
508508 }
509509 }
510- var options = Object . assign ( { } , this . fetchOptions , fetchOptions ) ;
510+ var options = Utils . mergeDeep ( { } , this . fetchOptions , fetchOptions ) ;
511511 return Utils . sendRequest ( this , options ) ;
512512 }
513513
0 commit comments