1 line
7.5 KiB
JSON
1 line
7.5 KiB
JSON
{"ast":null,"code":"exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableStream);\nexports.writableStream = isFunction(global.WritableStream);\nexports.abortController = isFunction(global.AbortController);\nexports.blobConstructor = false;\n\ntry {\n new Blob([new ArrayBuffer(1)]);\n exports.blobConstructor = true;\n} catch (e) {} // The xhr request to example.com may violate some restrictive CSP configurations,\n// so if we're running in a browser that supports `fetch`, avoid calling getXHR()\n// and assume support for certain features below.\n\n\nvar xhr;\n\nfunction getXHR() {\n // Cache the xhr value\n if (xhr !== undefined) return xhr;\n\n if (global.XMLHttpRequest) {\n xhr = new global.XMLHttpRequest(); // If XDomainRequest is available (ie only, where xhr might not work\n // cross domain), use the page location. Otherwise use example.com\n // Note: this doesn't actually make an http request.\n\n try {\n xhr.open('GET', global.XDomainRequest ? '/' : 'https://example.com');\n } catch (e) {\n xhr = null;\n }\n } else {\n // Service workers don't have XHR\n xhr = null;\n }\n\n return xhr;\n}\n\nfunction checkTypeSupport(type) {\n var xhr = getXHR();\n if (!xhr) return false;\n\n try {\n xhr.responseType = type;\n return xhr.responseType === type;\n } catch (e) {}\n\n return false;\n} // For some strange reason, Safari 7.0 reports typeof global.ArrayBuffer === 'object'.\n// Safari 7.1 appears to have fixed this bug.\n\n\nvar haveArrayBuffer = typeof global.ArrayBuffer !== 'undefined';\nvar haveSlice = haveArrayBuffer && isFunction(global.ArrayBuffer.prototype.slice); // If fetch is supported, then arraybuffer will be supported too. Skip calling\n// checkTypeSupport(), since that calls getXHR().\n\nexports.arraybuffer = exports.fetch || haveArrayBuffer && checkTypeSupport('arraybuffer'); // These next two tests unavoidably show warnings in Chrome. Since fetch will always\n// be used if it's available, just return false for these to avoid the warnings.\n\nexports.msstream = !exports.fetch && haveSlice && checkTypeSupport('ms-stream');\nexports.mozchunkedarraybuffer = !exports.fetch && haveArrayBuffer && checkTypeSupport('moz-chunked-arraybuffer'); // If fetch is supported, then overrideMimeType will be supported too. Skip calling\n// getXHR().\n\nexports.overrideMimeType = exports.fetch || (getXHR() ? isFunction(getXHR().overrideMimeType) : false);\nexports.vbArray = isFunction(global.VBArray);\n\nfunction isFunction(value) {\n return typeof value === 'function';\n}\n\nxhr = null; // Help gc","map":{"version":3,"sources":["/Users/tylerkoenig/Code/personal/react-scss2/node_modules/stream-http/lib/capability.js"],"names":["exports","fetch","isFunction","global","ReadableStream","writableStream","WritableStream","abortController","AbortController","blobConstructor","Blob","ArrayBuffer","e","xhr","getXHR","undefined","XMLHttpRequest","open","XDomainRequest","checkTypeSupport","type","responseType","haveArrayBuffer","haveSlice","prototype","slice","arraybuffer","msstream","mozchunkedarraybuffer","overrideMimeType","vbArray","VBArray","value"],"mappings":"AAAAA,OAAO,CAACC,KAAR,GAAgBC,UAAU,CAACC,MAAM,CAACF,KAAR,CAAV,IAA4BC,UAAU,CAACC,MAAM,CAACC,cAAR,CAAtD;AAEAJ,OAAO,CAACK,cAAR,GAAyBH,UAAU,CAACC,MAAM,CAACG,cAAR,CAAnC;AAEAN,OAAO,CAACO,eAAR,GAA0BL,UAAU,CAACC,MAAM,CAACK,eAAR,CAApC;AAEAR,OAAO,CAACS,eAAR,GAA0B,KAA1B;;AACA,IAAI;AACH,MAAIC,IAAJ,CAAS,CAAC,IAAIC,WAAJ,CAAgB,CAAhB,CAAD,CAAT;AACAX,EAAAA,OAAO,CAACS,eAAR,GAA0B,IAA1B;AACA,CAHD,CAGE,OAAOG,CAAP,EAAU,CAAE,C,CAEd;AACA;AACA;;;AACA,IAAIC,GAAJ;;AACA,SAASC,MAAT,GAAmB;AAClB;AACA,MAAID,GAAG,KAAKE,SAAZ,EAAuB,OAAOF,GAAP;;AAEvB,MAAIV,MAAM,CAACa,cAAX,EAA2B;AAC1BH,IAAAA,GAAG,GAAG,IAAIV,MAAM,CAACa,cAAX,EAAN,CAD0B,CAE1B;AACA;AACA;;AACA,QAAI;AACHH,MAAAA,GAAG,CAACI,IAAJ,CAAS,KAAT,EAAgBd,MAA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GAAkB5B,UAAU,CAACC,MAAM,CAAC4B,OAAR,CAA5B;;AAEA,SAAS7B,UAAT,CAAqB8B,KAArB,EAA4B;AAC3B,SAAO,OAAOA,KAAP,KAAiB,UAAxB;AACA;;AAEDnB,GAAG,GAAG,IAAN,C,CAAW","sourcesContent":["exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableStream)\n\nexports.writableStream = isFunction(global.WritableStream)\n\nexports.abortController = isFunction(global.AbortController)\n\nexports.blobConstructor = false\ntry {\n\tnew Blob([new ArrayBuffer(1)])\n\texports.blobConstructor = true\n} catch (e) {}\n\n// The xhr request to example.com may violate some restrictive CSP configurations,\n// so if we're running in a browser that supports `fetch`, avoid calling getXHR()\n// and assume support for certain features below.\nvar xhr\nfunction getXHR () {\n\t// Cache the xhr value\n\tif (xhr !== undefined) return xhr\n\n\tif (global.XMLHttpRequest) {\n\t\txhr = new global.XMLHttpRequest()\n\t\t// If XDomainRequest is available (ie only, where xhr might not work\n\t\t// cross domain), use the page location. Otherwise use example.com\n\t\t// Note: this doesn't actually make an http request.\n\t\ttry {\n\t\t\txhr.open('GET', global.XDomainRequest ? '/' : 'https://example.com')\n\t\t} catch(e) {\n\t\t\txhr = null\n\t\t}\n\t} else {\n\t\t// Service workers don't have XHR\n\t\txhr = null\n\t}\n\treturn xhr\n}\n\nfunction checkTypeSupport (type) {\n\tvar xhr = getXHR()\n\tif (!xhr) return false\n\ttry {\n\t\txhr.responseType = type\n\t\treturn xhr.responseType === type\n\t} catch (e) {}\n\treturn false\n}\n\n// For some strange reason, Safari 7.0 reports typeof global.ArrayBuffer === 'object'.\n// Safari 7.1 appears to have fixed this bug.\nvar haveArrayBuffer = typeof global.ArrayBuffer !== 'undefined'\nvar haveSlice = haveArrayBuffer && isFunction(global.ArrayBuffer.prototype.slice)\n\n// If fetch is supported, then arraybuffer will be supported too. Skip calling\n// checkTypeSupport(), since that calls getXHR().\nexports.arraybuffer = exports.fetch || (haveArrayBuffer && checkTypeSupport('arraybuffer'))\n\n// These next two tests unavoidably show warnings in Chrome. Since fetch will always\n// be used if it's available, just return false for these to avoid the warnings.\nexports.msstream = !exports.fetch && haveSlice && checkTypeSupport('ms-stream')\nexports.mozchunkedarraybuffer = !exports.fetch && haveArrayBuffer &&\n\tcheckTypeSupport('moz-chunked-arraybuffer')\n\n// If fetch is supported, then overrideMimeType will be supported too. Skip calling\n// getXHR().\nexports.overrideMimeType = exports.fetch || (getXHR() ? isFunction(getXHR().overrideMimeType) : false)\n\nexports.vbArray = isFunction(global.VBArray)\n\nfunction isFunction (value) {\n\treturn typeof value === 'function'\n}\n\nxhr = null // Help gc\n"]},"metadata":{},"sourceType":"script"} |