doipjs/dist/doip.min.js

2 lines
174 KiB
JavaScript
Raw Normal View History

2021-04-22 07:52:25 -06:00
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).doip=e()}}((function(){return function e(t,o,r){function i(a,d){if(!o[a]){if(!t[a]){var n="function"==typeof require&&require;if(!d&&n)return n(a,!0);if(s)return s(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=o[a]={exports:{}};t[a][0].call(u.exports,(function(e){return i(t[a][1][e]||e)}),u,u.exports,e,t,o,r)}return o[a].exports}for(var s="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({"/home/yarmo/dev/doip/doipjs/node_modules/bent/src/browser.js":[function(e,t,o){"use strict";const r=e("./core");class i extends Error{constructor(e,...t){let o;super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,i),this.name="StatusError",this.message=e.statusMessage,this.statusCode=e.status,this.res=e,this.json=e.json.bind(e),this.text=e.text.bind(e),this.arrayBuffer=e.arrayBuffer.bind(e);Object.defineProperty(this,"responseBody",{get:()=>(o||(o=this.arrayBuffer()),o)}),this.headers={};for(const[t,o]of e.headers.entries())this.headers[t.toLowerCase()]=o}}t.exports=r(((e,t,o,r,s)=>async(a,d,n={})=>{a=s+(a||"");let l=new URL(a);if(r||(r={}),l.username&&(r.Authorization="Basic "+btoa(l.username+":"+l.password),l=new URL(l.protocol+"//"+l.host+l.pathname+l.search)),"https:"!==l.protocol&&"http:"!==l.protocol)throw new Error("Unknown protocol, "+l.protocol);if(d)if(d instanceof ArrayBuffer||ArrayBuffer.isView(d)||"string"==typeof d);else{if("object"!=typeof d)throw new Error("Unknown body type.");d=JSON.stringify(d),r["Content-Type"]="application/json"}n=new Headers({...r||{},...n});const u=await fetch(l,{method:t,headers:n,body:d});if(u.statusCode=u.status,!e.has(u.status))throw new i(u);return"json"===o?u.json():"buffer"===o?u.arrayBuffer():"string"===o?u.text():u}))},{"./core":"/home/yarmo/dev/doip/doipjs/node_modules/bent/src/core.js"}],"/home/yarmo/dev/doip/doipjs/node_modules/bent/src/core.js":[function(e,t,o){"use strict";const r=new Set(["json","buffer","string"]);t.exports=e=>(...t)=>{const o=new Set;let i,s,a,d="";return t.forEach((e=>{if("string"==typeof e)if(e.toUpperCase()===e){if(i){throw new Error(`Can't set method to ${e}, already set to ${i}.`)}i=e}else if(e.startsWith("http:")||e.startsWith("https:"))d=e;else{if(!r.has(e))throw new Error("Unknown encoding, "+e);s=e}else if("number"==typeof e)o.add(e);else{if("object"!=typeof e)throw new Error("Unknown type: "+typeof e);if(Array.isArray(e)||e instanceof Set)e.forEach((e=>o.add(e)));else{if(a)throw new Error("Cannot set headers twice.");a=e}}})),i||(i="GET"),0===o.size&&o.add(200),e(o,i,s,a,d)}},{}],"/home/yarmo/dev/doip/doipjs/node_modules/browser-or-node/lib/index.js":[function(e,t,o){(function(e){(function(){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r="undefined"!=typeof window&&void 0!==window.document,i="object"===("undefined"==typeof self?"undefined":t(self))&&self.constructor&&"DedicatedWorkerGlobalScope"===self.constructor.name,s=void 0!==e&&null!=e.versions&&null!=e.versions.node;o.isBrowser=r,o.isWebWorker=i,o.isNode=s,o.isJsDom=function(){return"undefined"!=typeof window&&"nodejs"===window.name||navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")}}).call(this)}).call(this,e("_process"))},{_process:"/home/yarmo/dev/doip/doipjs/node_modules/process/browser.js"}],"/home/yarmo/dev/doip/doipjs/node_modules/browserify/lib/_empty.js":[function(e,t,o){},{}],"/home/yarmo/dev/doip/doipjs/node_modules/decode-uri-component/index.js":[function(e,t,o){"use strict";var r="%[a-f0-9]{2}",i=new RegExp(r,"gi"),s=new RegExp("("+r+")+","gi");function a(e,t){try{return decodeURIComponent(e.join(""))}