Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mockforme

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mockforme - npm Package Compare versions

Comparing version 1.1.7 to 1.1.8

2

dist/mockforme.min.js

@@ -1,1 +0,1 @@

!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(this,(function(){return(()=>{"use strict";var e={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>i});const o=e=>{try{return e?e.toLowerCase():e}catch(e){return console.log(e),null}},n=function(e,t,o){var n;function r(){if(4==n.readyState)if(n.status.toString().match(/^20[0-9]$/)){var e=function(){var e=n.getResponseHeader("Content-Type"),t=n.responseText;if(e){var o=e.split(";");try{switch(o[0]){case"application/json":return JSON.parse(t);default:return t}}catch(e){throw"Unable to convert response header"}}}();t.call(this,e,n)}else o.call(this,n.responseText,n)}function i(e,t){var o=[];for(var n in e)if(e.hasOwnProperty(n)){var r=t?t+"["+n+"]":n,a=e[n];o.push("object"==typeof a?i(a,r):encodeURIComponent(r)+"="+encodeURIComponent(a))}return o.join("&")}return window.XMLHttpRequest?n=new XMLHttpRequest:window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLHTTP")),{request:function(){if(window.XMLHttpRequest)n.onload=r;else{if(!window.ActiveXObject)throw"unable to process ajax";n.onreadystatechange=r}var t=i(e.params);if("get"==e.method.toLowerCase()&&"object"==typeof e.params){if(-1==e.url.indexOf("?"))e.url+="?";else{var o=e.url.split("?");o[1]&&o[1].split("=")[1]&&(e.url+="&")}e.url+=t}e.hasOwnProperty("async")||(e.async=!0),n.open(e.method,e.url,e.async),e.headers&&function(e){for(let t in e)n.setRequestHeader(t,e[t])}(e.headers),n.send(t)}}},r=e=>{const t="https://dashboard.mockforme.com",r=`${t}/mockforme`,i=`${t}/gateway/op/getEnabledApisForSdk`,a="mockforme";let s=[];const c=window.location,l=c.protocol;if(c.host,c.port,!e)throw"mockforme token cannot be null";const p=(e,t="get")=>{let n=null;if(!Array.isArray(s))return n;for(let r=0;r<s.length;r++){const i=s[r];if(o(i.apiMethod)===o(t)&&i.apiEndpoint===e){n={url:i.apiEndpoint,method:i.apiMethod};break}}return n},d=()=>{(()=>{const t=window.fetch;window.fetch=function(o,n={}){n.method||(n.method="get");let i=arguments;o&&(o.startsWith("//")?o=`${window.location.protocol}${o}`:o.startsWith("/")&&(o=`${window.location.origin}${o}`));const s=new URL(o),c=s&&s.pathname,l=p(c,n.method);return l&&(o=`${r}${l.url}`,i[0]=o,n.headers={[a]:e}),t.call(this,o,n)}})(),(()=>{let t=window.XMLHttpRequest.prototype.open;window.XMLHttpRequest.prototype.open=function(o,n,i,s,c){try{n&&(n.startsWith("//")?n=`${window.location.protocol}${n}`:n.startsWith("/")?n=`${window.location.origin}${n}`:!n.indexOf("://")>-1&&(n=`${l}//${n}`));const i=new URL(n),s=i&&i.pathname;let c=arguments;const d=p(s,o);return d&&(c[1]=`${r}${d.url}`),this.onreadystatechange=function(){1==this.readyState&&this.setRequestHeader(a,e)},t.apply(this,c)}catch(e){return console.log("Error in mock api, could be invalid url",e),t.apply(this,arguments)}}})()};return{initialize:e=>{var t;d(),t=t=>{e&&e(t)},n({method:"get",url:i,async:!1},(e=>{var o;e&&(o=e,s=s.concat(o)),t(e)}),(()=>{console.log("Error in loading mocked apis")})).request()}}};window.mockforme=r;const i=r;return t})()}));
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(this,(function(){return(()=>{"use strict";var e={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>i});const o=e=>{try{return e?e.toLowerCase():e}catch(e){return console.log(e),null}},n=function(e,t,o){var n;function r(){if(4==n.readyState)if(n.status.toString().match(/^20[0-9]$/)){var e=function(){var e=n.getResponseHeader("Content-Type"),t=n.responseText;if(e){var o=e.split(";");try{switch(o[0]){case"application/json":return JSON.parse(t);default:return t}}catch(e){throw"Unable to convert response header"}}}();t.call(this,e,n)}else o.call(this,n.responseText,n)}function i(e,t){var o=[];for(var n in e)if(e.hasOwnProperty(n)){var r=t?t+"["+n+"]":n,a=e[n];o.push("object"==typeof a?i(a,r):encodeURIComponent(r)+"="+encodeURIComponent(a))}return o.join("&")}return window.XMLHttpRequest?n=new XMLHttpRequest:window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLHTTP")),{request:function(){if(window.XMLHttpRequest)n.onload=r;else{if(!window.ActiveXObject)throw"unable to process ajax";n.onreadystatechange=r}var t=i(e.params);if("get"==e.method.toLowerCase()&&"object"==typeof e.params){if(-1==e.url.indexOf("?"))e.url+="?";else{var o=e.url.split("?");o[1]&&o[1].split("=")[1]&&(e.url+="&")}e.url+=t}e.hasOwnProperty("async")||(e.async=!0),n.open(e.method,e.url,e.async),e.headers&&function(e){for(let t in e)n.setRequestHeader(t,e[t])}(e.headers),n.send(t)}}},r=e=>{const t="https://dashboard.mockforme.com",r=`${t}/mockforme`,i=`${t}/gateway/op/getEnabledApisForSdk`,a="mockforme";let s=[];const c=window.location,l=c.protocol;if(c.host,c.port,!e)throw"mockforme token cannot be null";const p=(e,t="get")=>{let n=null;if(!Array.isArray(s))return n;for(let r=0;r<s.length;r++){const i=s[r];if(o(i.apiMethod)===o(t)&&i.apiEndpoint===e){n={url:i.apiEndpoint,method:i.apiMethod};break}}return n},d=()=>{(()=>{const t=window.fetch;window.fetch=function(o,n={}){n.method||(n.method="get");let i=arguments;o&&(o.startsWith("//")?o=`${window.location.protocol}${o}`:o.startsWith("/")&&(o=`${window.location.origin}${o}`));const s=new URL(o),c=s&&s.pathname,l=p(c,n.method);return l&&(o=`${r}${l.url}`,i[0]=o,n.headers={[a]:e}),t.call(this,o,n)}})(),(()=>{let t=window.XMLHttpRequest.prototype.open;window.XMLHttpRequest.prototype.open=function(o,n,i,s,c){try{n&&(n.startsWith("//")?n=`${window.location.protocol}${n}`:n.startsWith("/")?n=`${window.location.origin}${n}`:n.indexOf("://")>-1||(n=`${l}//${n}`));const i=new URL(n),s=i&&i.pathname;let c=arguments;const d=p(s,o);return d&&(c[1]=`${r}${d.url}`),this.onreadystatechange=function(){1==this.readyState&&this.setRequestHeader(a,e)},t.apply(this,c)}catch(e){return console.log("Error in mock api, could be invalid url",e),t.apply(this,arguments)}}})()};return{initialize:e=>{var t;d(),t=t=>{e&&e(t)},n({method:"get",url:i,async:!1},(e=>{var o;e&&(o=e,s=s.concat(o)),t(e)}),(()=>{console.log("Error in loading mocked apis")})).request()}}};window.mockforme=r;const i=r;return t})()}));
{
"name": "mockforme",
"version": "1.1.7",
"version": "1.1.8",
"description": "mockforme client integration kit. Intercept APIs & get mock responses. Integrate mockforme SDK with your codebase in seconds",

@@ -5,0 +5,0 @@ "main": "dist/mockforme.min.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc