@loaders.gl/core
Advanced tools
Comparing version 1.2.0-beta.3 to 1.2.0-beta.4
@@ -1,1 +0,1 @@ | ||
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t=n();for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(window,function(){return function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=4)}([function(e,n,t){"use strict";(function(e,r){t.d(n,"c",function(){return o}),t.d(n,"e",function(){return u}),t.d(n,"f",function(){return c}),t.d(n,"b",function(){return a}),t.d(n,"a",function(){return s}),t.d(n,"d",function(){return l});const o="object"!=typeof e||"[object process]"!==String(e)||e.browser,i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==r&&r,document:"undefined"!=typeof document&&document},u=i.self||i.window||i.global,c=i.window||i.self||i.global,a=i.global||i.self||i.window,s=i.document||{},f=void 0!==e&&e.version.match(/v([0-9]*)/),l=f&&parseFloat(f[1])||0}).call(this,t(5),t(3))},function(e,n){},function(e,n){},function(e,n){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,n,t){(function(n){const r=t(6),o="undefined"==typeof window?n:window;o.loaders=o.loaders||{},e.exports=Object.assign(o.loaders,r)}).call(this,t(3))},function(e,n){var t,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(e){r=u}}();var a,s=[],f=!1,l=-1;function d(){f&&a&&(f=!1,a.length?s=a.concat(s):l=-1,s.length&&y())}function y(){if(!f){var e=c(d);f=!0;for(var n=s.length;n;){for(a=s,s=[];++l<n;)a&&a[l].run();l=-1,n=s.length}a=null,f=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(n){try{return r.call(null,e)}catch(n){return r.call(this,e)}}}(e)}}function p(e,n){this.fun=e,this.array=n}function w(){}o.nextTick=function(e){var n=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)n[t-1]=arguments[t];s.push(new p(e,n)),1!==s.length||f||c(y)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=w,o.addListener=w,o.once=w,o.off=w,o.removeListener=w,o.removeAllListeners=w,o.emit=w,o.prependListener=w,o.prependOnceListener=w,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,n,t){"use strict";t.r(n);const r=e=>"boolean"==typeof e,o=e=>"function"==typeof e,i=e=>null!==e&&"object"==typeof e,u=e=>i(e)&&o(e.then),c=e=>e&&"function"==typeof e[Symbol.iterator],a=e=>e&&"function"==typeof e[Symbol.asyncIterator],s=e=>i(e)&&"done"in e&&"value"in e,f=e=>"undefined"!=typeof Response&&e instanceof Response||e.arrayBuffer&&e.text&&e.json,l=e=>(e=>"undefined"!=typeof File&&e instanceof File)(e)||(e=>"undefined"!=typeof Blob&&e instanceof Blob)(e),d=e=>(e=>i(e)&&o(e.tee)&&o(e.cancel)&&o(e.pipeTo)&&o(e.getReader))(e)||(e=>i(e)&&o(e.read)&&o(e.pipe)&&r(e.readable))(e),y=e=>(e=>i(e)&&o(e.abort)&&o(e.getWriter))(e)||(e=>i(e)&&o(e.end)&&o(e.write)&&r(e.writable))(e);function p(e,n){if(!e)throw new Error(n||"loader assertion failed.")}function w(e){if(!e)return!1;return Array.isArray(e)&&(e=e[0]),e.parseTextSync||e.parseSync||e.parse||e.loadAndParse||e.parseStream||e.parseInBatches||e.worker}function b(e){let n;return p(w(e)),Array.isArray(e)&&(n=(e=e[0])[1],e={...e,options:{...e.options,options:n}}),e.extension&&(e.extensions=e.extensions||e.extension,delete e.extension),Array.isArray(e.extensions)||(e.extensions=[e.extensions]),p(e.extensions&&e.extensions.length>0&&e.extensions[0]),e.parseTextSync&&(e.text=!0),e.text||(e.binary=!0),e}const h=/[^.]+$/;function g(e,n,{url:t=""}={}){let r=null;return r=(r=r||function(e,n){const t=n.match(h),r=t&&t[0];return r&&function(e,n){n=n.toLowerCase();for(const t of e){b(t);for(const e of t.extensions)if(e.toLowerCase()===n)return t}return null}(e,r)}(n,t))||function(e,n){for(const t of e)if("string"==typeof n){if(A(n,t))return t}else if(n instanceof ArrayBuffer&&m(n,t))return t;return null}(n,e)}function A(e,n){return n.testText&&n.testText(e)}function m(e,n){switch(Array.isArray(n.test)?"array":typeof n.test){case"function":return n.test(e,n);case"string":case"array":const t=0;return(Array.isArray(n.test)?n.test:[n.test]).some(n=>{return n===function(e,n=0,t){if(e.byteLength<=n+t)return"";const r=new DataView(e);let o="";for(let e=0;e<t;e++)o+=String.fromCharCode(r.getUint8(n+e));return o}(e,t,n.length)});default:return!1}}class x{log(){}info(){}warn(){}error(){}}function T(e,n){return null===(e=Object.assign({},n&&n.DEFAULT_OPTIONS,n&&n.defaultOptions,n&&n.options,e,{dataType:"arraybuffer"})).log&&(e.log=new x),"log"in e||(e.log=console),e}const S={};function B(e){e=Array.isArray(e)?e:[e];for(const n of e){b(n);for(const e of n.extensions)S[e]=n}}function v(){return Object.values(S)}const F=e=>e&&e instanceof ArrayBuffer,O=e=>e&&"undefined"!=typeof Blob&&e instanceof Blob,j=e=>e&&e instanceof Buffer;function I(e){if(F(e))return e;if(j(e)){return new Uint8Array(e).buffer}if(ArrayBuffer.isView(e))return e.buffer;if("string"==typeof e){const n=e;return(new TextEncoder).encode(n).buffer}return p(!1)}function E(e){return new Promise((n,t)=>{let r;const o=new FileReader;o.onload=e=>{r=e.target.result},o.onloadend=e=>n(r),o.onerror=t,o.readAsArrayBuffer(e)})}function L(e){return new DataView(I(e))}const P=new Map;function _(e,n,t){const r=function(e){let n=P.get(e);if(!n){const t=new Blob([e],{type:"application/javascript"});n=URL.createObjectURL(t),P.set(e,n)}return new Worker(n)}(e);t=function(e){null!==(e=Object.assign({},e)).log&&delete e.log;return e}(t);const o=(e,n)=>new Promise((t,o)=>{r.onmessage=e=>{switch(e.data.type){case"done":t(e.data.result),r.terminate();break;case"error":o(new Error(e.data.message))}};const i=I(e);r.postMessage({arraybuffer:i,opts:n},[i])});return n?o(n,t):o}var R=t(0);function U(e){if(R.c||R.d>=10){if("function"==typeof e[Symbol.asyncIterator])return e;if("function"==typeof e.getIterator)return e.getIterator()}return R.c?async function*(e){const n=e.getReader();try{for(;;){const{done:e,value:t}=await n.read();if(e)return;yield t}}finally{n.releaseLock()}}(e):async function*(e){e=await e;for(;;){const n=e.read();if(null===n){if(e._readableState.ended)return;await D(e)}else yield n}}(e)}async function D(e){return new Promise(n=>{e.once("readable",n)})}class k{constructor(e){this._fileOrBlob=e,this.bodyUsed=!1}get headers(){return new Headers({"Content-Length":this._fileOrBlob.size,"Content-Type":this._fileOrBlob.type})}url(){return this._fileOrBlob.name||""}async arrayBuffer(){const{reader:e,promise:n}=this._getFileReader();return e.readAsArrayBuffer(this._fileOrBlob),n}async text(){const{reader:e,promise:n}=this._getFileReader();return e.readAsText(this._fileOrBlob),n}async json(){const e=await this.text();return JSON.parse(e)}_getFileReader(){let e;p(!this.bodyUsed),this.bodyUsed=!0;const n=new Promise((n,t)=>{try{(e=new FileReader).onerror=e=>t(new Error(e)),e.onabort=()=>t(new Error("Read aborted.")),e.onload=()=>n(e.result)}catch(e){t(e)}});return{reader:e,promise:n}}}function C(e,n){return Promise.resolve(new k(e,n))}const M="Cannot convert supplied data type";function W(e,n){if(n.text&&"string"==typeof e)return e;if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)){const t=e.buffer||e;if(n.text&&!n.binary){return new TextDecoder("utf8").decode(t)}return t}throw new Error(M)}async function V(e,n){if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return function*(){yield e.buffer||e}();if(s(e))return e;if(c(e))return e[Symbol.iterator]();throw new Error(M)}async function $(e,n,t,r){return r=r||function(e){return f(e)?e.url:null}(e),e=await async function(e,n){const t=(e=await e)instanceof ArrayBuffer||ArrayBuffer.isView(e);if("string"==typeof e||t)return W(e,n);if(l(e)&&(e=await C(e)),f(e))return n.binary?await e.arrayBuffer():e.text();throw new Error(M)}(e,n),n.parseTextSync&&"string"==typeof e?(t.dataType="text",n.parseTextSync(e,t,r,n)):n.parseSync?n.parseSync(e,t,r,n):n.parse?await n.parse(e,t,r,n):n.worker?await _(n.worker,e,t):p(!1)}async function N(e,n,t,r){if(n.parseInBatches){const o=await async function(e,n){return s(e)?e:f(e)&&e.body?U(e.body):d(e)?U(e):a(e)?e[Symbol.asyncIterator]():V(e)}(e);return n.parseInBatches(o,t,r,n)}return null}async function z(e,n,t,r){Array.isArray(n)||w(n)||(r=t,t=n,n=null);const o=l(r)?r.name:r;n=n||v();const i=Array.isArray(n)?g(e,n,{url:o}):n;return i?(b(i),t=T(t,i),await $(e,i,t,o)):null}function H(e,n,t,r){Array.isArray(n)||w(n)||(r=t,t=n,n=null),n=n||v();const o=Array.isArray(n)?g(e,n,{url:r}):n;return b(o),function(e,n,t,r){return e=W(e,n),n.parseTextSync&&"string"==typeof e?n.parseTextSync(e,t,r,n):n.parseSync?n.parseSync(e,t,r,n):p(!1)}(e,o,t=T(t,o),r)}async function J(e,n,t,r){Array.isArray(n)||w(n)||(r=t,t=n,n=null),n=n||v();const o=Array.isArray(n)?g(null,n,{url:r}):n;return b(o),N(e,o,t=T(t,o),r)}async function q(e,n,t,r){Array.isArray(n)||w(n)||(r=t,t=n,n=null),n=n||v();const o=Array.isArray(n)?g(null,n,{url:r}):n;return b(o),N(e,o,t=T(t,o),r)}let G="";const K={};function Q(e){G=e}function X(){return G}function Y(e){for(const n in K)if(e.startsWith(n)){const t=K[n];return e.replace(n,t)}return e+=G}async function Z(e,n){return l(e)?C(e,n):(e=Y(e),fetch(e,n))}async function ee(e,n,t){return J(await Z(e,t),n,t,e)}async function ne(e,n,t){Array.isArray(n)||w(n)||(t=n,n=null);const r=l(e)?e.name:e;n=n||v();const o=Array.isArray(n)?g(null,n,{url:r}):n;if(t=T(t,o),o&&o.loadAndParse)return await o.loadAndParse(e,t);let i=e;return(l(i)||"string"==typeof i)&&(i=await Z(e,t)),z(i,n,t,r)}var te=t(2);const re={dataType:"arraybuffer",nothrow:!0},oe=e=>e.startsWith("data:");function ie(e,n){return n=function(e={}){return(e=Object.assign({},re,e)).responseType=e.responseType||e.dataType,e}(n),oe(e),n.nothrow||p(!1),null}function ue(e,n={}){return e=Y(e),!R.c&&te.readFileSync?te.readFileSync(e,n):ie(e,n)}var ce=t(1);function ae(e,n,t){return e=Y(e),!R.c&&ce.writeFile?ce.writeFile(e,n,t):p(!1)}function se(e,n,t){return e=Y(e),!R.c&&ce.writeFileSync?ce.writeFileSync(e,n,t):p(!1)}function fe(e){return`Failed to fetch resource ${e.url}(${e.status}): ${e.statusText} `}async function le(e){let n=`Failed to fetch resource ${e.url} (${e.status}): `;try{e.headers.get("Content-Type").includes("application/json")?n+=await e.text():n+=e.statusText}catch(e){return n}return n}function de(e,n,t,r){if(n.encode)return n.encode(e,t);if(n.encodeSync)return Promise.resolve(n.encodeSync(e,t));throw new Error("Writer could not encode data")}function ye(e,n,t,r){if(n.encodeSync)return n.encodeSync(e,t);throw new Error("Writer could not synchronously encode data")}function pe(e,n,t,r){if(n.encodeInBatches)return n.encodeInBatches(e,t);throw new Error("Writer could not encode data in batches")}function we(e,n,t,r){return ae(n,de(e,t,r))}function be(e,n,t,r){return se(n,ye(e,t,r))}function he(e){return e+3&-4}function ge(e,n,t,r=n.byteLength){const o=new Uint8Array(e,t,r),i=new Uint8Array(n);return o.set(i),e}function Ae(e,n,t){let r;if(e instanceof ArrayBuffer)r=new Uint8Array(e);else{const n=e.byteOffset,t=e.byteLength;r=new Uint8Array(e.buffer,n,t)}return n.set(r,t),t+he(r.byteLength)}function me(e,n){const t=e instanceof ArrayBuffer?new Uint8Array(e):e,r=n instanceof ArrayBuffer?new Uint8Array(n):n,o=new Uint8Array(t.byteLength+r.byteLength);return o.set(t,0),o.set(r,t.byteLength),o}async function xe(e,n){for(;;){const{done:t,value:r}=await e.next();if(t)return void e.return();if(n(r))return}}async function Te(e){let n=new ArrayBuffer,t="";for await(const r of e)"string"==typeof r?t+=r:n=me(n,r);return n||t}async function*Se(e,n){const t=new TextDecoder(n);for await(const n of e)yield"string"==typeof n?n:t.decode(n,{stream:!0})}async function*Be(e){let n="";for await(const t of e){let e;for(n+=t;(e=n.indexOf("\n"))>=0;){const t=n.slice(0,e+1);n=n.slice(e+1),yield t}}n.length>0&&(yield n)}async function*ve(e){let n=1;for await(const t of e)yield{counter:n,line:t},n++}t.d(n,"TextEncoder",function(){return Fe}),t.d(n,"TextDecoder",function(){return Oe}),t.d(n,"createReadStream",function(){return je}),t.d(n,"parseFile",function(){return Ie}),t.d(n,"parseFileSync",function(){return Ee}),t.d(n,"loadFile",function(){return Le}),t.d(n,"setPathPrefix",function(){return Q}),t.d(n,"getPathPrefix",function(){return X}),t.d(n,"resolvePath",function(){return Y}),t.d(n,"fetchFile",function(){return Z}),t.d(n,"readFileSync",function(){return ue}),t.d(n,"writeFile",function(){return ae}),t.d(n,"writeFileSync",function(){return se}),t.d(n,"_getErrorMessageFromResponseSync",function(){return fe}),t.d(n,"_getErrorMessageFromResponse",function(){return le}),t.d(n,"registerLoaders",function(){return B}),t.d(n,"parse",function(){return z}),t.d(n,"parseSync",function(){return H}),t.d(n,"parseInBatches",function(){return J}),t.d(n,"parseInBatchesSync",function(){return q}),t.d(n,"load",function(){return ne}),t.d(n,"loadInBatches",function(){return ee}),t.d(n,"encode",function(){return de}),t.d(n,"encodeSync",function(){return ye}),t.d(n,"encodeInBatches",function(){return pe}),t.d(n,"save",function(){return we}),t.d(n,"saveSync",function(){return be}),t.d(n,"isPromise",function(){return u}),t.d(n,"isIterable",function(){return c}),t.d(n,"isAsyncIterable",function(){return a}),t.d(n,"isIterator",function(){return s}),t.d(n,"isFetchResponse",function(){return f}),t.d(n,"isReadableStream",function(){return d}),t.d(n,"isWritableStream",function(){return y}),t.d(n,"isArrayBuffer",function(){return F}),t.d(n,"isBlob",function(){return O}),t.d(n,"toArrayBuffer",function(){return I}),t.d(n,"blobToArrayBuffer",function(){return E}),t.d(n,"toDataView",function(){return L}),t.d(n,"padTo4Bytes",function(){return he}),t.d(n,"copyToArray",function(){return Ae}),t.d(n,"copyArrayBuffer",function(){return ge}),t.d(n,"getStreamIterator",function(){return U}),t.d(n,"forEach",function(){return xe}),t.d(n,"concatenateAsyncIterator",function(){return Te}),t.d(n,"lineAsyncIterator",function(){return Be}),t.d(n,"textDecoderAsyncIterator",function(){return Se}),t.d(n,"numberedLineAsyncIterator",function(){return ve}),t.d(n,"isBrowser",function(){return R.c}),t.d(n,"self",function(){return R.e}),t.d(n,"window",function(){return R.f}),t.d(n,"global",function(){return R.b}),t.d(n,"document",function(){return R.a}),t.d(n,"assert",function(){return p});const Fe=R.b.TextEncoder,Oe=R.b.TextDecoder;async function je(e,n){return console.warn("createReadStream() deprecated, use fetch().then(resp => resp.body)"),e=Y(e),(await Z(e,n)).body}function Ie(...e){return console.warn("parse() deprecated, use parse()"),z(...e)}function Ee(...e){return console.warn("parseSync() deprecated, use parseSync()"),H(...e)}function Le(...e){return console.warn("loadFile() deprecated, use load()"),ne(...e)}}])}); | ||
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t=n();for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(window,function(){return function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=4)}([function(e,n,t){"use strict";(function(e,r){t.d(n,"c",function(){return o}),t.d(n,"e",function(){return u}),t.d(n,"f",function(){return c}),t.d(n,"b",function(){return a}),t.d(n,"a",function(){return s}),t.d(n,"d",function(){return l});const o="object"!=typeof e||"[object process]"!==String(e)||e.browser,i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==r&&r,document:"undefined"!=typeof document&&document},u=i.self||i.window||i.global,c=i.window||i.self||i.global,a=i.global||i.self||i.window,s=i.document||{},f=void 0!==e&&e.version.match(/v([0-9]*)/),l=f&&parseFloat(f[1])||0}).call(this,t(5),t(3))},function(e,n){},function(e,n){},function(e,n){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,n,t){(function(n){const r=t(6),o="undefined"==typeof window?n:window;o.loaders=o.loaders||{},e.exports=Object.assign(o.loaders,r)}).call(this,t(3))},function(e,n){var t,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(e){r=u}}();var a,s=[],f=!1,l=-1;function d(){f&&a&&(f=!1,a.length?s=a.concat(s):l=-1,s.length&&y())}function y(){if(!f){var e=c(d);f=!0;for(var n=s.length;n;){for(a=s,s=[];++l<n;)a&&a[l].run();l=-1,n=s.length}a=null,f=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(n){try{return r.call(null,e)}catch(n){return r.call(this,e)}}}(e)}}function p(e,n){this.fun=e,this.array=n}function w(){}o.nextTick=function(e){var n=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)n[t-1]=arguments[t];s.push(new p(e,n)),1!==s.length||f||c(y)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=w,o.addListener=w,o.once=w,o.off=w,o.removeListener=w,o.removeAllListeners=w,o.emit=w,o.prependListener=w,o.prependOnceListener=w,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,n,t){"use strict";t.r(n);const r=e=>"boolean"==typeof e,o=e=>"function"==typeof e,i=e=>null!==e&&"object"==typeof e,u=e=>i(e)&&o(e.then),c=e=>e&&"function"==typeof e[Symbol.iterator],a=e=>e&&"function"==typeof e[Symbol.asyncIterator],s=e=>i(e)&&"done"in e&&"value"in e,f=e=>"undefined"!=typeof Response&&e instanceof Response||e.arrayBuffer&&e.text&&e.json,l=e=>(e=>"undefined"!=typeof File&&e instanceof File)(e)||(e=>"undefined"!=typeof Blob&&e instanceof Blob)(e),d=e=>(e=>i(e)&&o(e.tee)&&o(e.cancel)&&o(e.pipeTo)&&o(e.getReader))(e)||(e=>i(e)&&o(e.read)&&o(e.pipe)&&r(e.readable))(e),y=e=>(e=>i(e)&&o(e.abort)&&o(e.getWriter))(e)||(e=>i(e)&&o(e.end)&&o(e.write)&&r(e.writable))(e);function p(e,n){if(!e)throw new Error(n||"loader assertion failed.")}function w(e){if(!e)return!1;return Array.isArray(e)&&(e=e[0]),e.parseTextSync||e.parseSync||e.parse||e.loadAndParse||e.parseStream||e.parseInBatches||e.worker}function b(e){let n;return p(w(e)),Array.isArray(e)&&(n=e[1],e=e[0],e={...e,options:{...e.options,...n}}),e.extension&&(e.extensions=e.extensions||e.extension,delete e.extension),Array.isArray(e.extensions)||(e.extensions=[e.extensions]),p(e.extensions&&e.extensions.length>0&&e.extensions[0]),e.parseTextSync&&(e.text=!0),e.text||(e.binary=!0),e}const h=/[^.]+$/;function g(e,n,{url:t=""}={}){let r=null;return r=(r=r||function(e,n){const t=n.match(h),r=t&&t[0];return r&&function(e,n){n=n.toLowerCase();for(const t of e){b(t);for(const e of t.extensions)if(e.toLowerCase()===n)return t}return null}(e,r)}(n,t))||function(e,n){for(const t of e)if("string"==typeof n){if(A(n,t))return t}else if(n instanceof ArrayBuffer&&m(n,t))return t;return null}(n,e)}function A(e,n){return n.testText&&n.testText(e)}function m(e,n){switch(Array.isArray(n.test)?"array":typeof n.test){case"function":return n.test(e,n);case"string":case"array":const t=0;return(Array.isArray(n.test)?n.test:[n.test]).some(n=>{return n===function(e,n=0,t){if(e.byteLength<=n+t)return"";const r=new DataView(e);let o="";for(let e=0;e<t;e++)o+=String.fromCharCode(r.getUint8(n+e));return o}(e,t,n.length)});default:return!1}}class x{log(){}info(){}warn(){}error(){}}function T(e,n){return null===(e=Object.assign({},n&&n.DEFAULT_OPTIONS,n&&n.defaultOptions,n&&n.options,e,{dataType:"arraybuffer"})).log&&(e.log=new x),"log"in e||(e.log=console),e}const S={};function B(e){e=Array.isArray(e)?e:[e];for(const n of e){const e=b(n);for(const n of e.extensions)S[n]=e}}function v(){return Object.values(S)}const F=e=>e&&e instanceof ArrayBuffer,O=e=>e&&"undefined"!=typeof Blob&&e instanceof Blob,j=e=>e&&e instanceof Buffer;function I(e){if(F(e))return e;if(j(e)){return new Uint8Array(e).buffer}if(ArrayBuffer.isView(e))return e.buffer;if("string"==typeof e){const n=e;return(new TextEncoder).encode(n).buffer}return p(!1)}function E(e){return new Promise((n,t)=>{let r;const o=new FileReader;o.onload=e=>{r=e.target.result},o.onloadend=e=>n(r),o.onerror=t,o.readAsArrayBuffer(e)})}function L(e){return new DataView(I(e))}const P=new Map;function _(e,n,t){const r=function(e){let n=P.get(e);if(!n){const t=new Blob([e],{type:"application/javascript"});n=URL.createObjectURL(t),P.set(e,n)}return new Worker(n)}(e);t=function(e){null!==(e=Object.assign({},e)).log&&delete e.log;return e}(t);const o=(e,n)=>new Promise((t,o)=>{r.onmessage=e=>{switch(e.data.type){case"done":t(e.data.result),r.terminate();break;case"error":o(new Error(e.data.message))}};const i=I(e);r.postMessage({arraybuffer:i,opts:n},[i])});return n?o(n,t):o}var R=t(0);function U(e){if(R.c||R.d>=10){if("function"==typeof e[Symbol.asyncIterator])return e;if("function"==typeof e.getIterator)return e.getIterator()}return R.c?async function*(e){const n=e.getReader();try{for(;;){const{done:e,value:t}=await n.read();if(e)return;yield t}}finally{n.releaseLock()}}(e):async function*(e){e=await e;for(;;){const n=e.read();if(null===n){if(e._readableState.ended)return;await D(e)}else yield n}}(e)}async function D(e){return new Promise(n=>{e.once("readable",n)})}class k{constructor(e){this._fileOrBlob=e,this.bodyUsed=!1}get headers(){return new Headers({"Content-Length":this._fileOrBlob.size,"Content-Type":this._fileOrBlob.type})}url(){return this._fileOrBlob.name||""}async arrayBuffer(){const{reader:e,promise:n}=this._getFileReader();return e.readAsArrayBuffer(this._fileOrBlob),n}async text(){const{reader:e,promise:n}=this._getFileReader();return e.readAsText(this._fileOrBlob),n}async json(){const e=await this.text();return JSON.parse(e)}_getFileReader(){let e;p(!this.bodyUsed),this.bodyUsed=!0;const n=new Promise((n,t)=>{try{(e=new FileReader).onerror=e=>t(new Error(e)),e.onabort=()=>t(new Error("Read aborted.")),e.onload=()=>n(e.result)}catch(e){t(e)}});return{reader:e,promise:n}}}function C(e,n){return Promise.resolve(new k(e,n))}const M="Cannot convert supplied data type";function W(e,n){if(n.text&&"string"==typeof e)return e;if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)){const t=e.buffer||e;if(n.text&&!n.binary){return new TextDecoder("utf8").decode(t)}return t}throw new Error(M)}async function V(e,n){if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return function*(){yield e.buffer||e}();if(s(e))return e;if(c(e))return e[Symbol.iterator]();throw new Error(M)}async function $(e,n,t,r){return r=r||function(e){return f(e)?e.url:null}(e),e=await async function(e,n){const t=(e=await e)instanceof ArrayBuffer||ArrayBuffer.isView(e);if("string"==typeof e||t)return W(e,n);if(l(e)&&(e=await C(e)),f(e))return n.binary?await e.arrayBuffer():e.text();throw new Error(M)}(e,n),n.parseTextSync&&"string"==typeof e?(t.dataType="text",n.parseTextSync(e,t,r,n)):n.parseSync?n.parseSync(e,t,r,n):n.parse?await n.parse(e,t,r,n):n.worker?await _(n.worker,e,t):p(!1)}async function N(e,n,t,r){if(n.parseInBatches){const o=await async function(e,n){return s(e)?e:f(e)&&e.body?U(e.body):d(e)?U(e):a(e)?e[Symbol.asyncIterator]():V(e)}(e);return n.parseInBatches(o,t,r,n)}return null}async function z(e,n,t,r){Array.isArray(n)||w(n)||(r=t,t=n,n=null);const o=l(r)?r.name:r;n=n||v();const i=Array.isArray(n)?g(e,n,{url:o}):n;return i?(b(i),t=T(t,i),await $(e,i,t,o)):null}function H(e,n,t,r){Array.isArray(n)||w(n)||(r=t,t=n,n=null),n=n||v();const o=Array.isArray(n)?g(e,n,{url:r}):n;return b(o),function(e,n,t,r){return e=W(e,n),n.parseTextSync&&"string"==typeof e?n.parseTextSync(e,t,r,n):n.parseSync?n.parseSync(e,t,r,n):p(!1)}(e,o,t=T(t,o),r)}async function J(e,n,t,r){Array.isArray(n)||w(n)||(r=t,t=n,n=null),n=n||v();const o=Array.isArray(n)?g(null,n,{url:r}):n;return b(o),N(e,o,t=T(t,o),r)}async function q(e,n,t,r){Array.isArray(n)||w(n)||(r=t,t=n,n=null),n=n||v();const o=Array.isArray(n)?g(null,n,{url:r}):n;return b(o),N(e,o,t=T(t,o),r)}let G="";const K={};function Q(e){G=e}function X(){return G}function Y(e){for(const n in K)if(e.startsWith(n)){const t=K[n];return e.replace(n,t)}return e+=G}async function Z(e,n){return l(e)?C(e,n):(e=Y(e),fetch(e,n))}async function ee(e,n,t){return J(await Z(e,t),n,t,e)}async function ne(e,n,t){Array.isArray(n)||w(n)||(t=n,n=null);const r=l(e)?e.name:e;n=n||v();const o=Array.isArray(n)?g(null,n,{url:r}):n;if(t=T(t,o),o&&o.loadAndParse)return await o.loadAndParse(e,t);let i=e;return(l(i)||"string"==typeof i)&&(i=await Z(e,t)),z(i,n,t,r)}var te=t(2);const re={dataType:"arraybuffer",nothrow:!0},oe=e=>e.startsWith("data:");function ie(e,n){return n=function(e={}){return(e=Object.assign({},re,e)).responseType=e.responseType||e.dataType,e}(n),oe(e),n.nothrow||p(!1),null}function ue(e,n={}){return e=Y(e),!R.c&&te.readFileSync?te.readFileSync(e,n):ie(e,n)}var ce=t(1);function ae(e,n,t){return e=Y(e),!R.c&&ce.writeFile?ce.writeFile(e,n,t):p(!1)}function se(e,n,t){return e=Y(e),!R.c&&ce.writeFileSync?ce.writeFileSync(e,n,t):p(!1)}function fe(e){return`Failed to fetch resource ${e.url}(${e.status}): ${e.statusText} `}async function le(e){let n=`Failed to fetch resource ${e.url} (${e.status}): `;try{e.headers.get("Content-Type").includes("application/json")?n+=await e.text():n+=e.statusText}catch(e){return n}return n}function de(e,n,t,r){if(n.encode)return n.encode(e,t);if(n.encodeSync)return Promise.resolve(n.encodeSync(e,t));throw new Error("Writer could not encode data")}function ye(e,n,t,r){if(n.encodeSync)return n.encodeSync(e,t);throw new Error("Writer could not synchronously encode data")}function pe(e,n,t,r){if(n.encodeInBatches)return n.encodeInBatches(e,t);throw new Error("Writer could not encode data in batches")}function we(e,n,t,r){return ae(n,de(e,t,r))}function be(e,n,t,r){return se(n,ye(e,t,r))}function he(e){return e+3&-4}function ge(e,n,t,r=n.byteLength){const o=new Uint8Array(e,t,r),i=new Uint8Array(n);return o.set(i),e}function Ae(e,n,t){let r;if(e instanceof ArrayBuffer)r=new Uint8Array(e);else{const n=e.byteOffset,t=e.byteLength;r=new Uint8Array(e.buffer,n,t)}return n.set(r,t),t+he(r.byteLength)}function me(e,n){const t=e instanceof ArrayBuffer?new Uint8Array(e):e,r=n instanceof ArrayBuffer?new Uint8Array(n):n,o=new Uint8Array(t.byteLength+r.byteLength);return o.set(t,0),o.set(r,t.byteLength),o}async function xe(e,n){for(;;){const{done:t,value:r}=await e.next();if(t)return void e.return();if(n(r))return}}async function Te(e){let n=new ArrayBuffer,t="";for await(const r of e)"string"==typeof r?t+=r:n=me(n,r);return n||t}async function*Se(e,n){const t=new TextDecoder(n);for await(const n of e)yield"string"==typeof n?n:t.decode(n,{stream:!0})}async function*Be(e){let n="";for await(const t of e){let e;for(n+=t;(e=n.indexOf("\n"))>=0;){const t=n.slice(0,e+1);n=n.slice(e+1),yield t}}n.length>0&&(yield n)}async function*ve(e){let n=1;for await(const t of e)yield{counter:n,line:t},n++}t.d(n,"TextEncoder",function(){return Fe}),t.d(n,"TextDecoder",function(){return Oe}),t.d(n,"createReadStream",function(){return je}),t.d(n,"parseFile",function(){return Ie}),t.d(n,"parseFileSync",function(){return Ee}),t.d(n,"loadFile",function(){return Le}),t.d(n,"setPathPrefix",function(){return Q}),t.d(n,"getPathPrefix",function(){return X}),t.d(n,"resolvePath",function(){return Y}),t.d(n,"fetchFile",function(){return Z}),t.d(n,"readFileSync",function(){return ue}),t.d(n,"writeFile",function(){return ae}),t.d(n,"writeFileSync",function(){return se}),t.d(n,"_getErrorMessageFromResponseSync",function(){return fe}),t.d(n,"_getErrorMessageFromResponse",function(){return le}),t.d(n,"registerLoaders",function(){return B}),t.d(n,"parse",function(){return z}),t.d(n,"parseSync",function(){return H}),t.d(n,"parseInBatches",function(){return J}),t.d(n,"parseInBatchesSync",function(){return q}),t.d(n,"load",function(){return ne}),t.d(n,"loadInBatches",function(){return ee}),t.d(n,"encode",function(){return de}),t.d(n,"encodeSync",function(){return ye}),t.d(n,"encodeInBatches",function(){return pe}),t.d(n,"save",function(){return we}),t.d(n,"saveSync",function(){return be}),t.d(n,"isPromise",function(){return u}),t.d(n,"isIterable",function(){return c}),t.d(n,"isAsyncIterable",function(){return a}),t.d(n,"isIterator",function(){return s}),t.d(n,"isFetchResponse",function(){return f}),t.d(n,"isReadableStream",function(){return d}),t.d(n,"isWritableStream",function(){return y}),t.d(n,"isArrayBuffer",function(){return F}),t.d(n,"isBlob",function(){return O}),t.d(n,"toArrayBuffer",function(){return I}),t.d(n,"blobToArrayBuffer",function(){return E}),t.d(n,"toDataView",function(){return L}),t.d(n,"padTo4Bytes",function(){return he}),t.d(n,"copyToArray",function(){return Ae}),t.d(n,"copyArrayBuffer",function(){return ge}),t.d(n,"getStreamIterator",function(){return U}),t.d(n,"forEach",function(){return xe}),t.d(n,"concatenateAsyncIterator",function(){return Te}),t.d(n,"lineAsyncIterator",function(){return Be}),t.d(n,"textDecoderAsyncIterator",function(){return Se}),t.d(n,"numberedLineAsyncIterator",function(){return ve}),t.d(n,"isBrowser",function(){return R.c}),t.d(n,"self",function(){return R.e}),t.d(n,"window",function(){return R.f}),t.d(n,"global",function(){return R.b}),t.d(n,"document",function(){return R.a}),t.d(n,"assert",function(){return p});const Fe=R.b.TextEncoder,Oe=R.b.TextDecoder;async function je(e,n){return console.warn("createReadStream() deprecated, use fetch().then(resp => resp.body)"),e=Y(e),(await Z(e,n)).body}function Ie(...e){return console.warn("parse() deprecated, use parse()"),z(...e)}function Ee(...e){return console.warn("parseSync() deprecated, use parseSync()"),H(...e)}function Le(...e){return console.warn("loadFile() deprecated, use load()"),ne(...e)}}])}); |
@@ -37,8 +37,6 @@ "use strict"; | ||
if (Array.isArray(loader)) { | ||
options = loader[1]; | ||
loader = loader[0]; | ||
options = loader[1]; | ||
loader = _objectSpread({}, loader, { | ||
options: _objectSpread({}, loader.options, { | ||
options: options | ||
}) | ||
options: _objectSpread({}, loader.options, {}, options) | ||
}); | ||
@@ -45,0 +43,0 @@ } |
@@ -22,3 +22,3 @@ "use strict"; | ||
var loader = _step.value; | ||
(0, _normalizeLoader.normalizeLoader)(loader); | ||
var normalizedLoader = (0, _normalizeLoader.normalizeLoader)(loader); | ||
var _iteratorNormalCompletion2 = true; | ||
@@ -29,5 +29,5 @@ var _didIteratorError2 = false; | ||
try { | ||
for (var _iterator2 = loader.extensions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { | ||
for (var _iterator2 = normalizedLoader.extensions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { | ||
var extension = _step2.value; | ||
registeredLoaders[extension] = loader; | ||
registeredLoaders[extension] = normalizedLoader; | ||
} | ||
@@ -34,0 +34,0 @@ } catch (err) { |
@@ -25,8 +25,6 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
if (Array.isArray(loader)) { | ||
options = loader[1]; | ||
loader = loader[0]; | ||
options = loader[1]; | ||
loader = _objectSpread({}, loader, { | ||
options: _objectSpread({}, loader.options, { | ||
options | ||
}) | ||
options: _objectSpread({}, loader.options, {}, options) | ||
}); | ||
@@ -33,0 +31,0 @@ } |
@@ -7,6 +7,6 @@ import { normalizeLoader } from './loader-utils/normalize-loader'; | ||
for (var loader of loaders) { | ||
normalizeLoader(loader); | ||
var normalizedLoader = normalizeLoader(loader); | ||
for (var extension of loader.extensions) { | ||
registeredLoaders[extension] = loader; | ||
for (var extension of normalizedLoader.extensions) { | ||
registeredLoaders[extension] = normalizedLoader; | ||
} | ||
@@ -13,0 +13,0 @@ } |
@@ -25,8 +25,6 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
if (Array.isArray(loader)) { | ||
options = loader[1]; | ||
loader = loader[0]; | ||
options = loader[1]; | ||
loader = _objectSpread({}, loader, { | ||
options: _objectSpread({}, loader.options, { | ||
options: options | ||
}) | ||
options: _objectSpread({}, loader.options, {}, options) | ||
}); | ||
@@ -33,0 +31,0 @@ } |
@@ -12,3 +12,3 @@ import { normalizeLoader } from './loader-utils/normalize-loader'; | ||
var loader = _step.value; | ||
normalizeLoader(loader); | ||
var normalizedLoader = normalizeLoader(loader); | ||
var _iteratorNormalCompletion2 = true; | ||
@@ -19,5 +19,5 @@ var _didIteratorError2 = false; | ||
try { | ||
for (var _iterator2 = loader.extensions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { | ||
for (var _iterator2 = normalizedLoader.extensions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { | ||
var extension = _step2.value; | ||
registeredLoaders[extension] = loader; | ||
registeredLoaders[extension] = normalizedLoader; | ||
} | ||
@@ -24,0 +24,0 @@ } catch (err) { |
{ | ||
"name": "@loaders.gl/core", | ||
"version": "1.2.0-beta.3", | ||
"version": "1.2.0-beta.4", | ||
"description": "Framework-independent loaders for 3D graphics formats", | ||
@@ -43,3 +43,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "39442622efe0e06323db958c53c9805fc9b7699d" | ||
"gitHead": "b1ac84e1667c817400d7089a55a67393c893b2b1" | ||
} |
@@ -33,7 +33,7 @@ import assert from '../../utils/assert'; | ||
if (Array.isArray(loader)) { | ||
options = loader[1]; | ||
loader = loader[0]; | ||
options = loader[1]; | ||
loader = { | ||
...loader, | ||
options: {...loader.options, options} | ||
options: {...loader.options, ...options} | ||
}; | ||
@@ -40,0 +40,0 @@ } |
@@ -8,5 +8,5 @@ import {normalizeLoader} from './loader-utils/normalize-loader'; | ||
for (const loader of loaders) { | ||
normalizeLoader(loader); | ||
for (const extension of loader.extensions) { | ||
registeredLoaders[extension] = loader; | ||
const normalizedLoader = normalizeLoader(loader); | ||
for (const extension of normalizedLoader.extensions) { | ||
registeredLoaders[extension] = normalizedLoader; | ||
} | ||
@@ -13,0 +13,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
650784
8676