@@ -101,10 +101,10 @@ export function createOc(oc) {
101101
102102 const getHeaders = ( ) => {
103103 const globalHeaders = ocConf . globalHeaders ;
104- return $ . extend (
105- { Accept : "application/vnd.oc.unrendered+json" } ,
106- typeof globalHeaders == "function" ? globalHeaders ( ) : globalHeaders ,
107- ) ;
104+ return {
105+ Accept : "application/vnd.oc.unrendered+json" ,
106+ ... ( typeof globalHeaders == "function" ? globalHeaders ( ) : globalHeaders ) ,
107+ } ;
108108 } ;
109109
110110 oc . addStylesToHead = ( styles ) => {
@@ -224,7 +224,7 @@ export function createOc(oc) {
224224 action : options . action ,
225225 name : name ,
226226 version : version ,
227- parameters : $ . extend ( { } , ocConf . globalParameters , options . parameters ) ,
227+ parameters : { ... ocConf . globalParameters , ... options . parameters } ,
228228 } ,
229229 ] ,
230230 } ;
@@ -253,14 +253,12 @@ export function createOc(oc) {
253253 return new Promise ( ( resolve , reject ) => {
254254 const name = options . component ;
255255 getData (
256- $ . extend (
257- {
258- json : true ,
259- name : name ,
260- } ,
261- renderedComponents [ name ] ,
262- options ,
263- ) ,
256+ {
257+ json : true ,
258+ name : name ,
259+ ...renderedComponents [ name ] ,
260+ ...options ,
261+ } ,
264262
265263 ( err , data ) => {
266264 if ( err ) {
@@ -300,12 +298,12 @@ export function createOc(oc) {
300298
301299 if ( options . parameters ) {
302300 href += "?" ;
303- $ . each ( options . parameters , ( key , value ) => {
301+ for ( let [ key , value ] of Object . entries ( options . parameters ) ) {
304302 if ( / [ + & = ] / . test ( value ) ) {
305303 value = encodeURIComponent ( value ) ;
306304 }
307305 href += key + "=" + value + "&" ;
308- } ) ;
306+ }
309307
310308 href = href . slice ( 0 , - 1 ) ;
311309 }
@@ -477,14 +475,10 @@ export function createOc(oc) {
477475 callback ( MESSAGES_ERRORS_RENDERING + MESSAGES_ERRORS_HREF_MISSING ) ;
478476 } else {
479477 $ . ajax ( {
480- url : addParametersToHref (
481- href ,
482- $ . extend (
483- { } ,
484- ocConf . globalParameters ,
485- RETRY_SEND_NUMBER && { __oc_Retry : retryNumber } ,
486- ) ,
487- ) ,
478+ url : addParametersToHref ( href , {
479+ ...ocConf . globalParameters ,
480+ ...( RETRY_SEND_NUMBER ? { __oc_Retry : retryNumber } : { } ) ,
481+ } ) ,
488482 headers : getHeaders ( ) ,
489483 contentType : "text/plain" ,
490484 crossDomain : true ,
0 commit comments