cropduster
Advanced tools
Comparing version 5.3.0 to 5.4.0
@@ -1,2 +0,2 @@ | ||
var CD=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n="callbacks are deprecated in cropduster, prefer using promises for asynchronous operations",o={CORS_PROXY_SERVER:"http://cors.movableink.com",$:(e,t)=>(t||(t=document),[...t.querySelectorAll(e)]),_initParams(){o._urlParams={};const e=/([^&=]+)=?([^&]*)/g,t=o._searchString();let r=e.exec(t);for(;r;)o._urlParams[decodeURIComponent(r[1])]=decodeURIComponent(r[2]),r=e.exec(t)},param:e=>o.params()[e],params(e){let t=o._urlParams;return void 0===t&&(o._initParams(),t=o._urlParams),e?t[e]:t},_searchString:()=>window.location.search.substring(1),autofill(){o.param("init");const e=o._urlParams;for(const t in e)"undefined"!==e[t]&&e[t].length>0&&document.getElementById(`autofill_${t}`)&&(document.getElementById(`autofill_${t}`).innerHTML=e[t])},throwError(e){o.miCaptureFallback(()=>{MICapture.error(e)},()=>{o.log("Capturama error: "+e)})},cancelRequest(e){o.miCaptureFallback(()=>{MICapture.cancel(e)},()=>{o.log(`Request canceled: ${e}`)})},setImageRedirect(e){const t=document.getElementById("mi-redirect-image")||document.createElement("a");return t.href=e,t.id="mi-redirect-image",t.style.display="none",document.body.appendChild(t),t},setClickthrough(e){const t=document.getElementById("mi_dynamic_link")||document.createElement("a");return t.href=e,t.id="mi_dynamic_link",t.style.display="none",document.body.appendChild(t),t},setExtraData(e){const t=document.getElementById("mi-data")||document.createElement("div");let r;t.id="mi-data",t.style.display="none";try{r=JSON.parse(t.getAttribute("data-mi-data"))||{}}catch(e){r={}}for(const n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return t.setAttribute("data-mi-data",JSON.stringify(r)),document.body.appendChild(t),t},proxyUrl(e){const t=document.createElement("a");t.href=e;let r="";r="0"===t.port||""===t.port?"https:"===t.protocol?":443":"":`:${t.port}`;const{hostname:n,pathname:a,search:s,hash:u}=t;return`${o.CORS_PROXY_SERVER}/${n}${r}${a}${s}${u}`},_readyToCapture:!0,_reset(){o._readyToCapture=!0},pause(e,t="manual suspension"){e&&(t+=`, will end in ${e}ms`,setTimeout(()=>{o.resume(t)},e)),o.miCaptureFallback(()=>{MICapture.pause(t)},()=>{o.log(`paused: ${t}`)})},resume(e){o.miCaptureFallback(()=>{MICapture.resume(e)},()=>{o.log(`resuming paused capture: ${e}`)})},getCORS(e,t={},r){return"function"==typeof t&&(r=t,t={}),t.corsCacheTime=t.corsCacheTime||1e4,/cors.movableink.com/.test(e)||(e=o.proxyUrl(e)),t.headers=t.headers||{},t.headers["x-reverse-proxy-ttl"]=t.corsCacheTime/1e3,t.headers["x-mi-cbe"]=this._hashForRequest(e,t),o.get(e,t,r)},get(e,t={},r){"function"==typeof t&&(r=t,t={});const a=`xhr: ${e}`,s=function(){if(r&&"function"==typeof r)return o.log(n),r(...arguments)};o.pause(t.maxSuspension||0,a);const u=o._optionsForFetch(t);return fetch(e,u).then(e=>{if(!e.ok)throw new Error(e.statusText);return e.text().then(t=>{const r=e.status,n=e.headers.get("Content-Type");return s(t,r,n),{data:t,status:r,contentType:n}})}).then(e=>(o.resume(a),e),t=>{throw o.log(`Error encountered in CD.get for ${e}: ${t}`),o.resume(a),s(null),t})},getImage(e,t={},r){"function"==typeof t&&(r=t,t={});const a=function(){if(r&&"function"==typeof r)return o.log(n),r(...arguments)},s=`getImage: ${e}`;return new Promise(function(r,n){const u=new Image;u.onload=function(){o.resume(s),a(u),r(u)},u.onerror=function(e){o.resume(s),a(null),n(e)},o.pause(t.maxSuspension,s),u.src=e})},getImages(e,t={},r,a){const s="getImages:";o.pause(t.maxSuspension,s),"function"==typeof t&&(a=r,r=t,t={});const u=e.map(e=>this.getImage(e,t.maxSuspension).then(e=>(r&&r(e),e)));return Promise.all(u).then(e=>(a&&(o.log(n),a(e)),o.resume(s),e),e=>{throw o.resume(s),new Error("Not all images loaded successfully")})},waitForAsset(e){o.miCaptureFallback(()=>{MICapture.waitForAsset(e)},()=>{o.log(`Wait for asset: ${e}`)})},log(e){console.log(e)},miCaptureFallback(e,t){const r=!!window.MICapture&&"object"==typeof window.MICapture;return r?e():t()},_hashForRequest(e,t){const r=`${e}${JSON.stringify(t)}`;let n=0;if(0===r.length)return n;for(let o=0;o<r.length;o++)n=(n<<5)-n+r.charCodeAt(o)&4294967295;return n.toString()},_optionsForFetch(e){const t={redirect:"follow",headers:new Headers(e.headers||{}),method:e.method||"GET",body:e.body,mode:"cors"};return e.withoutCredentials||(t.credentials="include"),t}};t.default=o}]); | ||
var CD=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n="callbacks are deprecated in cropduster, prefer using promises for asynchronous operations",o={CORS_PROXY_SERVER:"http://cors.movableink.com",$:(e,t)=>(t||(t=document),[...t.querySelectorAll(e)]),_initParams(){o._urlParams={};const e=/([^&=]+)=?([^&]*)/g,t=o._searchString();let r=e.exec(t);for(;r;)o._urlParams[decodeURIComponent(r[1])]=decodeURIComponent(r[2]),r=e.exec(t)},param:e=>o.params()[e],params(e){let t=o._urlParams;return void 0===t&&(o._initParams(),t=o._urlParams),e?t[e]:t},_searchString:()=>window.location.search.substring(1),autofill(){o.param("init");const e=o._urlParams;for(const t in e)"undefined"!==e[t]&&e[t].length>0&&document.getElementById(`autofill_${t}`)&&(document.getElementById(`autofill_${t}`).innerHTML=e[t])},throwError(e){o.miCaptureFallback(()=>{MICapture.error(e)},()=>{o.log("Capturama error: "+e)})},cancelRequest(e){o.miCaptureFallback(()=>{MICapture.cancel(e)},()=>{o.log(`Request canceled: ${e}`)})},setImageRedirect(e){const t=document.getElementById("mi-redirect-image")||document.createElement("a");return t.href=e,t.id="mi-redirect-image",t.style.display="none",document.body.appendChild(t),t},setClickthrough(e){const t=document.getElementById("mi_dynamic_link")||document.createElement("a");return t.href=e,t.id="mi_dynamic_link",t.style.display="none",document.body.appendChild(t),t},setExtraData(e){const t=document.getElementById("mi-data")||document.createElement("div");let r;t.id="mi-data",t.style.display="none";try{r=JSON.parse(t.getAttribute("data-mi-data"))||{}}catch(e){r={}}for(const n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return t.setAttribute("data-mi-data",JSON.stringify(r)),document.body.appendChild(t),t},proxyUrl(e){const t=document.createElement("a");t.href=e;let r="";r="0"===t.port||""===t.port?"https:"===t.protocol?":443":"":`:${t.port}`;const{hostname:n,pathname:a,search:s,hash:u}=t;return`${o.CORS_PROXY_SERVER}/${n}${r}${a}${s}${u}`},_readyToCapture:!0,_reset(){o._readyToCapture=!0},pause(e,t="manual suspension"){e&&(t+=`, will end in ${e}ms`,setTimeout(()=>{o.resume(t)},e)),o.miCaptureFallback(()=>{MICapture.pause(t)},()=>{o.log(`paused: ${t}`)})},resume(e){o.miCaptureFallback(()=>{MICapture.resume(e)},()=>{o.log(`resuming paused capture: ${e}`)})},getCORS(e,t={},r){return"function"==typeof t&&(r=t,t={}),t.corsCacheTime=t.corsCacheTime||1e4,/cors.movableink.com/.test(e)||(e=o.proxyUrl(e)),t.headers=t.headers||{},t.headers["x-reverse-proxy-ttl"]=t.corsCacheTime/1e3,t.headers["x-mi-cbe"]=this._hashForRequest(e,t),o.get(e,t,r)},get(e,t={},r){"function"==typeof t&&(r=t,t={});const a=`xhr: ${e}`,s=function(){if(r&&"function"==typeof r)return o.log(n),r(...arguments)};o.pause(t.maxSuspension||0,a);const u=o._optionsForFetch(t);return fetch(e,u).then(e=>{if(!e.ok)throw new Error(e.statusText);return e.text().then(t=>{const r=e.status,n=e.headers.get("Content-Type");return s(t,r,n),{data:t,status:r,contentType:n,response:e}})}).then(e=>(o.resume(a),e),t=>{throw o.log(`Error encountered in CD.get for ${e}: ${t}`),o.resume(a),s(null),t})},getImage(e,t={},r){"function"==typeof t&&(r=t,t={});const a=function(){if(r&&"function"==typeof r)return o.log(n),r(...arguments)},s=`getImage: ${e}`;return new Promise(function(r,n){const u=new Image;u.onload=function(){o.resume(s),a(u),r(u)},u.onerror=function(e){o.resume(s),a(null),n(e)},o.pause(t.maxSuspension,s),u.src=e})},getImages(e,t={},r,a){const s="getImages:";o.pause(t.maxSuspension,s),"function"==typeof t&&(a=r,r=t,t={});const u=e.map(e=>this.getImage(e,t.maxSuspension).then(e=>(r&&r(e),e)));return Promise.all(u).then(e=>(a&&(o.log(n),a(e)),o.resume(s),e),e=>{throw o.resume(s),new Error("Not all images loaded successfully")})},waitForAsset(e){o.miCaptureFallback(()=>{MICapture.waitForAsset(e)},()=>{o.log(`Wait for asset: ${e}`)})},log(e){console.log(e)},miCaptureFallback(e,t){const r=!!window.MICapture&&"object"==typeof window.MICapture;return r?e():t()},_hashForRequest(e,t){const r=`${e}${JSON.stringify(t)}`;let n=0;if(0===r.length)return n;for(let o=0;o<r.length;o++)n=(n<<5)-n+r.charCodeAt(o)&4294967295;return n.toString()},_optionsForFetch(e){const t={redirect:"follow",headers:new Headers(e.headers||{}),method:e.method||"GET",body:e.body,mode:"cors"};return e.withoutCredentials||(t.credentials="include"),t}};t.default=o}]); | ||
//# sourceMappingURL=cropduster.browser.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.cropduster=t():e.cropduster=t()}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n="callbacks are deprecated in cropduster, prefer using promises for asynchronous operations",o={CORS_PROXY_SERVER:"http://cors.movableink.com",$:(e,t)=>(t||(t=document),[...t.querySelectorAll(e)]),_initParams(){o._urlParams={};const e=/([^&=]+)=?([^&]*)/g,t=o._searchString();let r=e.exec(t);for(;r;)o._urlParams[decodeURIComponent(r[1])]=decodeURIComponent(r[2]),r=e.exec(t)},param:e=>o.params()[e],params(e){let t=o._urlParams;return void 0===t&&(o._initParams(),t=o._urlParams),e?t[e]:t},_searchString:()=>window.location.search.substring(1),autofill(){o.param("init");const e=o._urlParams;for(const t in e)"undefined"!==e[t]&&e[t].length>0&&document.getElementById(`autofill_${t}`)&&(document.getElementById(`autofill_${t}`).innerHTML=e[t])},throwError(e){o.miCaptureFallback(()=>{MICapture.error(e)},()=>{o.log("Capturama error: "+e)})},cancelRequest(e){o.miCaptureFallback(()=>{MICapture.cancel(e)},()=>{o.log(`Request canceled: ${e}`)})},setImageRedirect(e){const t=document.getElementById("mi-redirect-image")||document.createElement("a");return t.href=e,t.id="mi-redirect-image",t.style.display="none",document.body.appendChild(t),t},setClickthrough(e){const t=document.getElementById("mi_dynamic_link")||document.createElement("a");return t.href=e,t.id="mi_dynamic_link",t.style.display="none",document.body.appendChild(t),t},setExtraData(e){const t=document.getElementById("mi-data")||document.createElement("div");let r;t.id="mi-data",t.style.display="none";try{r=JSON.parse(t.getAttribute("data-mi-data"))||{}}catch(e){r={}}for(const n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return t.setAttribute("data-mi-data",JSON.stringify(r)),document.body.appendChild(t),t},proxyUrl(e){const t=document.createElement("a");t.href=e;let r="";r="0"===t.port||""===t.port?"https:"===t.protocol?":443":"":`:${t.port}`;const{hostname:n,pathname:a,search:s,hash:u}=t;return`${o.CORS_PROXY_SERVER}/${n}${r}${a}${s}${u}`},_readyToCapture:!0,_reset(){o._readyToCapture=!0},pause(e,t="manual suspension"){e&&(t+=`, will end in ${e}ms`,setTimeout(()=>{o.resume(t)},e)),o.miCaptureFallback(()=>{MICapture.pause(t)},()=>{o.log(`paused: ${t}`)})},resume(e){o.miCaptureFallback(()=>{MICapture.resume(e)},()=>{o.log(`resuming paused capture: ${e}`)})},getCORS(e,t={},r){return"function"==typeof t&&(r=t,t={}),t.corsCacheTime=t.corsCacheTime||1e4,/cors.movableink.com/.test(e)||(e=o.proxyUrl(e)),t.headers=t.headers||{},t.headers["x-reverse-proxy-ttl"]=t.corsCacheTime/1e3,t.headers["x-mi-cbe"]=this._hashForRequest(e,t),o.get(e,t,r)},get(e,t={},r){"function"==typeof t&&(r=t,t={});const a=`xhr: ${e}`,s=function(){if(r&&"function"==typeof r)return o.log(n),r(...arguments)};o.pause(t.maxSuspension||0,a);const u=o._optionsForFetch(t);return fetch(e,u).then(e=>{if(!e.ok)throw new Error(e.statusText);return e.text().then(t=>{const r=e.status,n=e.headers.get("Content-Type");return s(t,r,n),{data:t,status:r,contentType:n}})}).then(e=>(o.resume(a),e),t=>{throw o.log(`Error encountered in CD.get for ${e}: ${t}`),o.resume(a),s(null),t})},getImage(e,t={},r){"function"==typeof t&&(r=t,t={});const a=function(){if(r&&"function"==typeof r)return o.log(n),r(...arguments)},s=`getImage: ${e}`;return new Promise(function(r,n){const u=new Image;u.onload=function(){o.resume(s),a(u),r(u)},u.onerror=function(e){o.resume(s),a(null),n(e)},o.pause(t.maxSuspension,s),u.src=e})},getImages(e,t={},r,a){const s="getImages:";o.pause(t.maxSuspension,s),"function"==typeof t&&(a=r,r=t,t={});const u=e.map(e=>this.getImage(e,t.maxSuspension).then(e=>(r&&r(e),e)));return Promise.all(u).then(e=>(a&&(o.log(n),a(e)),o.resume(s),e),e=>{throw o.resume(s),new Error("Not all images loaded successfully")})},waitForAsset(e){o.miCaptureFallback(()=>{MICapture.waitForAsset(e)},()=>{o.log(`Wait for asset: ${e}`)})},log(e){console.log(e)},miCaptureFallback(e,t){const r=!!window.MICapture&&"object"==typeof window.MICapture;return r?e():t()},_hashForRequest(e,t){const r=`${e}${JSON.stringify(t)}`;let n=0;if(0===r.length)return n;for(let o=0;o<r.length;o++)n=(n<<5)-n+r.charCodeAt(o)&4294967295;return n.toString()},_optionsForFetch(e){const t={redirect:"follow",headers:new Headers(e.headers||{}),method:e.method||"GET",body:e.body,mode:"cors"};return e.withoutCredentials||(t.credentials="include"),t}};t.default=o}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.cropduster=t():e.cropduster=t()}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n="callbacks are deprecated in cropduster, prefer using promises for asynchronous operations",o={CORS_PROXY_SERVER:"http://cors.movableink.com",$:(e,t)=>(t||(t=document),[...t.querySelectorAll(e)]),_initParams(){o._urlParams={};const e=/([^&=]+)=?([^&]*)/g,t=o._searchString();let r=e.exec(t);for(;r;)o._urlParams[decodeURIComponent(r[1])]=decodeURIComponent(r[2]),r=e.exec(t)},param:e=>o.params()[e],params(e){let t=o._urlParams;return void 0===t&&(o._initParams(),t=o._urlParams),e?t[e]:t},_searchString:()=>window.location.search.substring(1),autofill(){o.param("init");const e=o._urlParams;for(const t in e)"undefined"!==e[t]&&e[t].length>0&&document.getElementById(`autofill_${t}`)&&(document.getElementById(`autofill_${t}`).innerHTML=e[t])},throwError(e){o.miCaptureFallback(()=>{MICapture.error(e)},()=>{o.log("Capturama error: "+e)})},cancelRequest(e){o.miCaptureFallback(()=>{MICapture.cancel(e)},()=>{o.log(`Request canceled: ${e}`)})},setImageRedirect(e){const t=document.getElementById("mi-redirect-image")||document.createElement("a");return t.href=e,t.id="mi-redirect-image",t.style.display="none",document.body.appendChild(t),t},setClickthrough(e){const t=document.getElementById("mi_dynamic_link")||document.createElement("a");return t.href=e,t.id="mi_dynamic_link",t.style.display="none",document.body.appendChild(t),t},setExtraData(e){const t=document.getElementById("mi-data")||document.createElement("div");let r;t.id="mi-data",t.style.display="none";try{r=JSON.parse(t.getAttribute("data-mi-data"))||{}}catch(e){r={}}for(const n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return t.setAttribute("data-mi-data",JSON.stringify(r)),document.body.appendChild(t),t},proxyUrl(e){const t=document.createElement("a");t.href=e;let r="";r="0"===t.port||""===t.port?"https:"===t.protocol?":443":"":`:${t.port}`;const{hostname:n,pathname:a,search:s,hash:u}=t;return`${o.CORS_PROXY_SERVER}/${n}${r}${a}${s}${u}`},_readyToCapture:!0,_reset(){o._readyToCapture=!0},pause(e,t="manual suspension"){e&&(t+=`, will end in ${e}ms`,setTimeout(()=>{o.resume(t)},e)),o.miCaptureFallback(()=>{MICapture.pause(t)},()=>{o.log(`paused: ${t}`)})},resume(e){o.miCaptureFallback(()=>{MICapture.resume(e)},()=>{o.log(`resuming paused capture: ${e}`)})},getCORS(e,t={},r){return"function"==typeof t&&(r=t,t={}),t.corsCacheTime=t.corsCacheTime||1e4,/cors.movableink.com/.test(e)||(e=o.proxyUrl(e)),t.headers=t.headers||{},t.headers["x-reverse-proxy-ttl"]=t.corsCacheTime/1e3,t.headers["x-mi-cbe"]=this._hashForRequest(e,t),o.get(e,t,r)},get(e,t={},r){"function"==typeof t&&(r=t,t={});const a=`xhr: ${e}`,s=function(){if(r&&"function"==typeof r)return o.log(n),r(...arguments)};o.pause(t.maxSuspension||0,a);const u=o._optionsForFetch(t);return fetch(e,u).then(e=>{if(!e.ok)throw new Error(e.statusText);return e.text().then(t=>{const r=e.status,n=e.headers.get("Content-Type");return s(t,r,n),{data:t,status:r,contentType:n,response:e}})}).then(e=>(o.resume(a),e),t=>{throw o.log(`Error encountered in CD.get for ${e}: ${t}`),o.resume(a),s(null),t})},getImage(e,t={},r){"function"==typeof t&&(r=t,t={});const a=function(){if(r&&"function"==typeof r)return o.log(n),r(...arguments)},s=`getImage: ${e}`;return new Promise(function(r,n){const u=new Image;u.onload=function(){o.resume(s),a(u),r(u)},u.onerror=function(e){o.resume(s),a(null),n(e)},o.pause(t.maxSuspension,s),u.src=e})},getImages(e,t={},r,a){const s="getImages:";o.pause(t.maxSuspension,s),"function"==typeof t&&(a=r,r=t,t={});const u=e.map(e=>this.getImage(e,t.maxSuspension).then(e=>(r&&r(e),e)));return Promise.all(u).then(e=>(a&&(o.log(n),a(e)),o.resume(s),e),e=>{throw o.resume(s),new Error("Not all images loaded successfully")})},waitForAsset(e){o.miCaptureFallback(()=>{MICapture.waitForAsset(e)},()=>{o.log(`Wait for asset: ${e}`)})},log(e){console.log(e)},miCaptureFallback(e,t){const r=!!window.MICapture&&"object"==typeof window.MICapture;return r?e():t()},_hashForRequest(e,t){const r=`${e}${JSON.stringify(t)}`;let n=0;if(0===r.length)return n;for(let o=0;o<r.length;o++)n=(n<<5)-n+r.charCodeAt(o)&4294967295;return n.toString()},_optionsForFetch(e){const t={redirect:"follow",headers:new Headers(e.headers||{}),method:e.method||"GET",body:e.body,mode:"cors"};return e.withoutCredentials||(t.credentials="include"),t}};t.default=o}])}); | ||
//# sourceMappingURL=cropduster.js.map |
@@ -0,1 +1,3 @@ | ||
const watchMode = process.env.KARMA_WATCH === 'true'; | ||
module.exports = function(config) { | ||
@@ -58,3 +60,3 @@ config.set({ | ||
// enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: false, | ||
autoWatch: watchMode, | ||
@@ -64,4 +66,4 @@ | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: true | ||
singleRun: !watchMode | ||
}); | ||
}; |
{ | ||
"name": "cropduster", | ||
"version": "5.3.0", | ||
"version": "5.4.0", | ||
"description": "Library for building web pages for use with Movable Ink Web Crops", | ||
@@ -30,2 +30,3 @@ "main": "dist/cropduster.js", | ||
"test": "yarn run karma start", | ||
"develop-test": "KARMA_WATCH=true yarn run karma start", | ||
"build": "yarn run webpack", | ||
@@ -32,0 +33,0 @@ "build:dev": "NODE_ENV=development yarn run webpack --watch", |
@@ -218,3 +218,4 @@ const DEPRECATION_MSG = 'callbacks are deprecated in cropduster, prefer using promises for asynchronous operations'; | ||
status, | ||
contentType | ||
contentType, | ||
response | ||
}; | ||
@@ -221,0 +222,0 @@ }); |
@@ -275,2 +275,20 @@ import CD from '../src/cropduster'; | ||
test("CD.get yields the response object to the resolved promise", function(assert) { | ||
const done = assert.async(); | ||
this.fakeServer.restore(); | ||
this.fakeServer = fetchMock.mock('*', { | ||
body: 'ok', | ||
headers: { | ||
'Content-Type': 'text/html', | ||
'Every-Thing-Is': 'awesome' | ||
} | ||
}); | ||
CD.get("http://callback.com").then(({ response }) => { | ||
assert.equal(response.headers.get('every-thing-is'), 'awesome', 'the response headers are available'); | ||
done(); | ||
}); | ||
}); | ||
test("DEPRECATED - CD.get with callbacks and a failing response", function(assert) { | ||
@@ -277,0 +295,0 @@ this.fakeServer.restore(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
264905
811
4