@loaders.gl/core 4.0.0-alpha.18 → 4.0.0-alpha.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dist.min.js CHANGED
@@ -2506,6 +2506,7 @@
2506
2506
  mimeType: void 0,
2507
2507
  nothrow: false,
2508
2508
  log: new ConsoleLog(),
2509
+ useLocalLibraries: false,
2509
2510
  CDN: "https://unpkg.com/@loaders.gl",
2510
2511
  worker: true,
2511
2512
  maxConcurrency: 3,
@@ -3151,12 +3152,12 @@
3151
3152
  // src/lib/loader-utils/get-fetch-function.ts
3152
3153
  function getFetchFunction(options, context) {
3153
3154
  const globalOptions = getGlobalLoaderOptions();
3154
- const fetchOptions = options || globalOptions;
3155
- if (typeof fetchOptions.fetch === "function") {
3156
- return fetchOptions.fetch;
3155
+ const loaderOptions = options || globalOptions;
3156
+ if (typeof loaderOptions.fetch === "function") {
3157
+ return loaderOptions.fetch;
3157
3158
  }
3158
- if (isObject(fetchOptions.fetch)) {
3159
- return (url) => fetchFile(url, fetchOptions);
3159
+ if (isObject(loaderOptions.fetch)) {
3160
+ return (url) => fetchFile(url, loaderOptions.fetch);
3160
3161
  }
3161
3162
  if (context?.fetch) {
3162
3163
  return context?.fetch;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _log = require("./utils/log");
8
- var version = typeof "4.0.0-alpha.18" !== 'undefined' ? "4.0.0-alpha.18" : '';
8
+ var version = typeof "4.0.0-alpha.20" !== 'undefined' ? "4.0.0-alpha.20" : '';
9
9
  if (!globalThis.loaders) {
10
10
  _log.log.log(1, "loaders.gl ".concat(version))();
11
11
  globalThis.loaders = Object.assign(globalThis.loaders || {}, {
@@ -9,13 +9,13 @@ var _fetchFile = require("../fetch/fetch-file");
9
9
  var _optionUtils = require("./option-utils");
10
10
  function getFetchFunction(options, context) {
11
11
  var globalOptions = (0, _optionUtils.getGlobalLoaderOptions)();
12
- var fetchOptions = options || globalOptions;
13
- if (typeof fetchOptions.fetch === 'function') {
14
- return fetchOptions.fetch;
12
+ var loaderOptions = options || globalOptions;
13
+ if (typeof loaderOptions.fetch === 'function') {
14
+ return loaderOptions.fetch;
15
15
  }
16
- if ((0, _isType.isObject)(fetchOptions.fetch)) {
16
+ if ((0, _isType.isObject)(loaderOptions.fetch)) {
17
17
  return function (url) {
18
- return (0, _fetchFile.fetchFile)(url, fetchOptions);
18
+ return (0, _fetchFile.fetchFile)(url, loaderOptions.fetch);
19
19
  };
20
20
  }
21
21
  if (context !== null && context !== void 0 && context.fetch) {
@@ -1 +1 @@
1
- {"version":3,"file":"get-fetch-function.js","names":["_isType","require","_fetchFile","_optionUtils","getFetchFunction","options","context","globalOptions","getGlobalLoaderOptions","fetchOptions","fetch","isObject","url","fetchFile"],"sources":["../../../../src/lib/loader-utils/get-fetch-function.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderContext, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {isObject} from '../../javascript-utils/is-type';\nimport {fetchFile} from '../fetch/fetch-file';\nimport {getGlobalLoaderOptions} from './option-utils';\n\n/**\n * Gets the current fetch function from options and context\n * @param options\n * @param context\n */\nexport function getFetchFunction(\n options?: LoaderOptions,\n context?: Omit<LoaderContext, 'fetch'> & Partial<Pick<LoaderContext, 'fetch'>>\n) {\n const globalOptions = getGlobalLoaderOptions();\n\n const fetchOptions = options || globalOptions;\n\n // options.fetch can be a function\n if (typeof fetchOptions.fetch === 'function') {\n return fetchOptions.fetch;\n }\n\n // options.fetch can be an options object\n if (isObject(fetchOptions.fetch)) {\n return (url) => fetchFile(url, fetchOptions as RequestInit);\n }\n\n // else refer to context (from parent loader) if available\n if (context?.fetch) {\n return context?.fetch;\n }\n\n // else return the default fetch function\n return fetchFile;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAOO,SAASG,gBAAgBA,CAC9BC,OAAuB,EACvBC,OAA8E,EAC9E;EACA,IAAMC,aAAa,GAAG,IAAAC,mCAAsB,EAAC,CAAC;EAE9C,IAAMC,YAAY,GAAGJ,OAAO,IAAIE,aAAa;EAG7C,IAAI,OAAOE,YAAY,CAACC,KAAK,KAAK,UAAU,EAAE;IAC5C,OAAOD,YAAY,CAACC,KAAK;EAC3B;EAGA,IAAI,IAAAC,gBAAQ,EAACF,YAAY,CAACC,KAAK,CAAC,EAAE;IAChC,OAAO,UAACE,GAAG;MAAA,OAAK,IAAAC,oBAAS,EAACD,GAAG,EAAEH,YAA2B,CAAC;IAAA;EAC7D;EAGA,IAAIH,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEI,KAAK,EAAE;IAClB,OAAOJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEI,KAAK;EACvB;EAGA,OAAOG,oBAAS;AAClB"}
1
+ {"version":3,"file":"get-fetch-function.js","names":["_isType","require","_fetchFile","_optionUtils","getFetchFunction","options","context","globalOptions","getGlobalLoaderOptions","loaderOptions","fetch","isObject","url","fetchFile"],"sources":["../../../../src/lib/loader-utils/get-fetch-function.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderContext, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {isObject} from '../../javascript-utils/is-type';\nimport {fetchFile} from '../fetch/fetch-file';\nimport {getGlobalLoaderOptions} from './option-utils';\n\n/**\n * Gets the current fetch function from options and context\n * @param options\n * @param context\n */\nexport function getFetchFunction(\n options?: LoaderOptions,\n context?: Omit<LoaderContext, 'fetch'> & Partial<Pick<LoaderContext, 'fetch'>>\n) {\n const globalOptions = getGlobalLoaderOptions();\n\n const loaderOptions = options || globalOptions;\n\n // options.fetch can be a function\n if (typeof loaderOptions.fetch === 'function') {\n return loaderOptions.fetch;\n }\n\n // options.fetch can be an options object\n if (isObject(loaderOptions.fetch)) {\n return (url) => fetchFile(url, loaderOptions.fetch as RequestInit);\n }\n\n // else refer to context (from parent loader) if available\n if (context?.fetch) {\n return context?.fetch;\n }\n\n // else return the default fetch function\n return fetchFile;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAOO,SAASG,gBAAgBA,CAC9BC,OAAuB,EACvBC,OAA8E,EAC9E;EACA,IAAMC,aAAa,GAAG,IAAAC,mCAAsB,EAAC,CAAC;EAE9C,IAAMC,aAAa,GAAGJ,OAAO,IAAIE,aAAa;EAG9C,IAAI,OAAOE,aAAa,CAACC,KAAK,KAAK,UAAU,EAAE;IAC7C,OAAOD,aAAa,CAACC,KAAK;EAC5B;EAGA,IAAI,IAAAC,gBAAQ,EAACF,aAAa,CAACC,KAAK,CAAC,EAAE;IACjC,OAAO,UAACE,GAAG;MAAA,OAAK,IAAAC,oBAAS,EAACD,GAAG,EAAEH,aAAa,CAACC,KAAoB,CAAC;IAAA;EACpE;EAGA,IAAIJ,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEI,KAAK,EAAE;IAClB,OAAOJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEI,KAAK;EACvB;EAGA,OAAOG,oBAAS;AAClB"}
@@ -11,6 +11,7 @@ var DEFAULT_LOADER_OPTIONS = {
11
11
  mimeType: undefined,
12
12
  nothrow: false,
13
13
  log: new _loggers.ConsoleLog(),
14
+ useLocalLibraries: false,
14
15
  CDN: 'https://unpkg.com/@loaders.gl',
15
16
  worker: true,
16
17
  maxConcurrency: 3,
@@ -1 +1 @@
1
- {"version":3,"file":"option-defaults.js","names":["_loaderUtils","require","_loggers","DEFAULT_LOADER_OPTIONS","fetch","mimeType","undefined","nothrow","log","ConsoleLog","CDN","worker","maxConcurrency","maxMobileConcurrency","reuseWorkers","isBrowser","_nodeWorkers","_workerType","limit","_limitMB","batchSize","batchDebounceMs","metadata","transforms","exports","REMOVED_LOADER_OPTIONS","throws","dataType","uri","method","headers","body","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"],"sources":["../../../../src/lib/loader-utils/option-defaults.ts"],"sourcesContent":["import type {LoaderOptions} from '@loaders.gl/loader-utils';\nimport {isBrowser} from '@loaders.gl/loader-utils';\nimport {ConsoleLog} from './loggers';\n\nexport const DEFAULT_LOADER_OPTIONS: LoaderOptions = {\n // baseUri\n fetch: null,\n mimeType: undefined,\n nothrow: false,\n log: new ConsoleLog(), // A probe.gl compatible (`log.log()()` syntax) that just logs to console\n\n CDN: 'https://unpkg.com/@loaders.gl',\n worker: true, // By default, use worker if provided by loader.\n maxConcurrency: 3, // How many worker instances should be created for each loader.\n maxMobileConcurrency: 1, // How many worker instances should be created for each loader on mobile devices.\n reuseWorkers: isBrowser, // By default reuse workers in browser (Node.js refuses to terminate if browsers are running)\n _nodeWorkers: false, // By default do not support node workers\n _workerType: '', // 'test' to use locally generated workers\n\n limit: 0,\n _limitMB: 0,\n batchSize: 'auto',\n batchDebounceMs: 0,\n metadata: false, // TODO - currently only implemented for parseInBatches, adds initial metadata batch,\n transforms: []\n};\n\nexport const REMOVED_LOADER_OPTIONS = {\n throws: 'nothrow',\n dataType: '(no longer used)',\n uri: 'baseUri',\n // Warn if fetch options are used on top-level\n method: 'fetch.method',\n headers: 'fetch.headers',\n body: 'fetch.body',\n mode: 'fetch.mode',\n credentials: 'fetch.credentials',\n cache: 'fetch.cache',\n redirect: 'fetch.redirect',\n referrer: 'fetch.referrer',\n referrerPolicy: 'fetch.referrerPolicy',\n integrity: 'fetch.integrity',\n keepalive: 'fetch.keepalive',\n signal: 'fetch.signal'\n};\n"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEO,IAAME,sBAAqC,GAAG;EAEnDC,KAAK,EAAE,IAAI;EACXC,QAAQ,EAAEC,SAAS;EACnBC,OAAO,EAAE,KAAK;EACdC,GAAG,EAAE,IAAIC,mBAAU,CAAC,CAAC;EAErBC,GAAG,EAAE,+BAA+B;EACpCC,MAAM,EAAE,IAAI;EACZC,cAAc,EAAE,CAAC;EACjBC,oBAAoB,EAAE,CAAC;EACvBC,YAAY,EAAEC,sBAAS;EACvBC,YAAY,EAAE,KAAK;EACnBC,WAAW,EAAE,EAAE;EAEfC,KAAK,EAAE,CAAC;EACRC,QAAQ,EAAE,CAAC;EACXC,SAAS,EAAE,MAAM;EACjBC,eAAe,EAAE,CAAC;EAClBC,QAAQ,EAAE,KAAK;EACfC,UAAU,EAAE;AACd,CAAC;AAACC,OAAA,CAAArB,sBAAA,GAAAA,sBAAA;AAEK,IAAMsB,sBAAsB,GAAG;EACpCC,MAAM,EAAE,SAAS;EACjBC,QAAQ,EAAE,kBAAkB;EAC5BC,GAAG,EAAE,SAAS;EAEdC,MAAM,EAAE,cAAc;EACtBC,OAAO,EAAE,eAAe;EACxBC,IAAI,EAAE,YAAY;EAClBC,IAAI,EAAE,YAAY;EAClBC,WAAW,EAAE,mBAAmB;EAChCC,KAAK,EAAE,aAAa;EACpBC,QAAQ,EAAE,gBAAgB;EAC1BC,QAAQ,EAAE,gBAAgB;EAC1BC,cAAc,EAAE,sBAAsB;EACtCC,SAAS,EAAE,iBAAiB;EAC5BC,SAAS,EAAE,iBAAiB;EAC5BC,MAAM,EAAE;AACV,CAAC;AAAChB,OAAA,CAAAC,sBAAA,GAAAA,sBAAA"}
1
+ {"version":3,"file":"option-defaults.js","names":["_loaderUtils","require","_loggers","DEFAULT_LOADER_OPTIONS","fetch","mimeType","undefined","nothrow","log","ConsoleLog","useLocalLibraries","CDN","worker","maxConcurrency","maxMobileConcurrency","reuseWorkers","isBrowser","_nodeWorkers","_workerType","limit","_limitMB","batchSize","batchDebounceMs","metadata","transforms","exports","REMOVED_LOADER_OPTIONS","throws","dataType","uri","method","headers","body","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"],"sources":["../../../../src/lib/loader-utils/option-defaults.ts"],"sourcesContent":["import type {LoaderOptions} from '@loaders.gl/loader-utils';\nimport {isBrowser} from '@loaders.gl/loader-utils';\nimport {ConsoleLog} from './loggers';\n\nexport const DEFAULT_LOADER_OPTIONS: LoaderOptions = {\n // baseUri\n fetch: null,\n mimeType: undefined,\n nothrow: false,\n log: new ConsoleLog(), // A probe.gl compatible (`log.log()()` syntax) that just logs to console\n useLocalLibraries: false,\n\n CDN: 'https://unpkg.com/@loaders.gl',\n worker: true, // By default, use worker if provided by loader.\n maxConcurrency: 3, // How many worker instances should be created for each loader.\n maxMobileConcurrency: 1, // How many worker instances should be created for each loader on mobile devices.\n reuseWorkers: isBrowser, // By default reuse workers in browser (Node.js refuses to terminate if browsers are running)\n _nodeWorkers: false, // By default do not support node workers\n _workerType: '', // 'test' to use locally generated workers\n\n limit: 0,\n _limitMB: 0,\n batchSize: 'auto',\n batchDebounceMs: 0,\n metadata: false, // TODO - currently only implemented for parseInBatches, adds initial metadata batch,\n transforms: []\n};\n\nexport const REMOVED_LOADER_OPTIONS = {\n throws: 'nothrow',\n dataType: '(no longer used)',\n uri: 'baseUri',\n // Warn if fetch options are used on top-level\n method: 'fetch.method',\n headers: 'fetch.headers',\n body: 'fetch.body',\n mode: 'fetch.mode',\n credentials: 'fetch.credentials',\n cache: 'fetch.cache',\n redirect: 'fetch.redirect',\n referrer: 'fetch.referrer',\n referrerPolicy: 'fetch.referrerPolicy',\n integrity: 'fetch.integrity',\n keepalive: 'fetch.keepalive',\n signal: 'fetch.signal'\n};\n"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEO,IAAME,sBAAqC,GAAG;EAEnDC,KAAK,EAAE,IAAI;EACXC,QAAQ,EAAEC,SAAS;EACnBC,OAAO,EAAE,KAAK;EACdC,GAAG,EAAE,IAAIC,mBAAU,CAAC,CAAC;EACrBC,iBAAiB,EAAE,KAAK;EAExBC,GAAG,EAAE,+BAA+B;EACpCC,MAAM,EAAE,IAAI;EACZC,cAAc,EAAE,CAAC;EACjBC,oBAAoB,EAAE,CAAC;EACvBC,YAAY,EAAEC,sBAAS;EACvBC,YAAY,EAAE,KAAK;EACnBC,WAAW,EAAE,EAAE;EAEfC,KAAK,EAAE,CAAC;EACRC,QAAQ,EAAE,CAAC;EACXC,SAAS,EAAE,MAAM;EACjBC,eAAe,EAAE,CAAC;EAClBC,QAAQ,EAAE,KAAK;EACfC,UAAU,EAAE;AACd,CAAC;AAACC,OAAA,CAAAtB,sBAAA,GAAAA,sBAAA;AAEK,IAAMuB,sBAAsB,GAAG;EACpCC,MAAM,EAAE,SAAS;EACjBC,QAAQ,EAAE,kBAAkB;EAC5BC,GAAG,EAAE,SAAS;EAEdC,MAAM,EAAE,cAAc;EACtBC,OAAO,EAAE,eAAe;EACxBC,IAAI,EAAE,YAAY;EAClBC,IAAI,EAAE,YAAY;EAClBC,WAAW,EAAE,mBAAmB;EAChCC,KAAK,EAAE,aAAa;EACpBC,QAAQ,EAAE,gBAAgB;EAC1BC,QAAQ,EAAE,gBAAgB;EAC1BC,cAAc,EAAE,sBAAsB;EACtCC,SAAS,EAAE,iBAAiB;EAC5BC,SAAS,EAAE,iBAAiB;EAC5BC,MAAM,EAAE;AACV,CAAC;AAAChB,OAAA,CAAAC,sBAAA,GAAAA,sBAAA"}
@@ -11,7 +11,7 @@ var _awaitAsyncGenerator2 = _interopRequireDefault(require("@babel/runtime/helpe
11
11
  var _wrapAsyncGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapAsyncGenerator"));
12
12
  function _asyncIterator(iterable) { var method, async, sync, retry = 2; for ("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;) { if (async && null != (method = iterable[async])) return method.call(iterable); if (sync && null != (method = iterable[sync])) return new AsyncFromSyncIterator(method.call(iterable)); async = "@@asyncIterator", sync = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
13
13
  function AsyncFromSyncIterator(s) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var done = r.done; return Promise.resolve(r.value).then(function (value) { return { value: value, done: done }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(s) { this.s = s, this.n = s.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, return: function _return(value) { var ret = this.s.return; return void 0 === ret ? Promise.resolve({ value: value, done: !0 }) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments)); }, throw: function _throw(value) { var thr = this.s.return; return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(s); }
14
- var VERSION = typeof "4.0.0-alpha.18" !== 'undefined' ? "4.0.0-alpha.18" : 'latest';
14
+ var VERSION = typeof "4.0.0-alpha.20" !== 'undefined' ? "4.0.0-alpha.20" : 'latest';
15
15
  var NullWorkerLoader = {
16
16
  name: 'Null loader',
17
17
  id: 'null',
@@ -1,5 +1,5 @@
1
1
  import { log } from './utils/log';
2
- const version = typeof "4.0.0-alpha.18" !== 'undefined' ? "4.0.0-alpha.18" : '';
2
+ const version = typeof "4.0.0-alpha.20" !== 'undefined' ? "4.0.0-alpha.20" : '';
3
3
  if (!globalThis.loaders) {
4
4
  log.log(1, "loaders.gl ".concat(version))();
5
5
  globalThis.loaders = Object.assign(globalThis.loaders || {}, {
@@ -3,12 +3,12 @@ import { fetchFile } from '../fetch/fetch-file';
3
3
  import { getGlobalLoaderOptions } from './option-utils';
4
4
  export function getFetchFunction(options, context) {
5
5
  const globalOptions = getGlobalLoaderOptions();
6
- const fetchOptions = options || globalOptions;
7
- if (typeof fetchOptions.fetch === 'function') {
8
- return fetchOptions.fetch;
6
+ const loaderOptions = options || globalOptions;
7
+ if (typeof loaderOptions.fetch === 'function') {
8
+ return loaderOptions.fetch;
9
9
  }
10
- if (isObject(fetchOptions.fetch)) {
11
- return url => fetchFile(url, fetchOptions);
10
+ if (isObject(loaderOptions.fetch)) {
11
+ return url => fetchFile(url, loaderOptions.fetch);
12
12
  }
13
13
  if (context !== null && context !== void 0 && context.fetch) {
14
14
  return context === null || context === void 0 ? void 0 : context.fetch;
@@ -1 +1 @@
1
- {"version":3,"file":"get-fetch-function.js","names":["isObject","fetchFile","getGlobalLoaderOptions","getFetchFunction","options","context","globalOptions","fetchOptions","fetch","url"],"sources":["../../../../src/lib/loader-utils/get-fetch-function.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderContext, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {isObject} from '../../javascript-utils/is-type';\nimport {fetchFile} from '../fetch/fetch-file';\nimport {getGlobalLoaderOptions} from './option-utils';\n\n/**\n * Gets the current fetch function from options and context\n * @param options\n * @param context\n */\nexport function getFetchFunction(\n options?: LoaderOptions,\n context?: Omit<LoaderContext, 'fetch'> & Partial<Pick<LoaderContext, 'fetch'>>\n) {\n const globalOptions = getGlobalLoaderOptions();\n\n const fetchOptions = options || globalOptions;\n\n // options.fetch can be a function\n if (typeof fetchOptions.fetch === 'function') {\n return fetchOptions.fetch;\n }\n\n // options.fetch can be an options object\n if (isObject(fetchOptions.fetch)) {\n return (url) => fetchFile(url, fetchOptions as RequestInit);\n }\n\n // else refer to context (from parent loader) if available\n if (context?.fetch) {\n return context?.fetch;\n }\n\n // else return the default fetch function\n return fetchFile;\n}\n"],"mappings":"AAGA,SAAQA,QAAQ,QAAO,gCAAgC;AACvD,SAAQC,SAAS,QAAO,qBAAqB;AAC7C,SAAQC,sBAAsB,QAAO,gBAAgB;AAOrD,OAAO,SAASC,gBAAgBA,CAC9BC,OAAuB,EACvBC,OAA8E,EAC9E;EACA,MAAMC,aAAa,GAAGJ,sBAAsB,CAAC,CAAC;EAE9C,MAAMK,YAAY,GAAGH,OAAO,IAAIE,aAAa;EAG7C,IAAI,OAAOC,YAAY,CAACC,KAAK,KAAK,UAAU,EAAE;IAC5C,OAAOD,YAAY,CAACC,KAAK;EAC3B;EAGA,IAAIR,QAAQ,CAACO,YAAY,CAACC,KAAK,CAAC,EAAE;IAChC,OAAQC,GAAG,IAAKR,SAAS,CAACQ,GAAG,EAAEF,YAA2B,CAAC;EAC7D;EAGA,IAAIF,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEG,KAAK,EAAE;IAClB,OAAOH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEG,KAAK;EACvB;EAGA,OAAOP,SAAS;AAClB"}
1
+ {"version":3,"file":"get-fetch-function.js","names":["isObject","fetchFile","getGlobalLoaderOptions","getFetchFunction","options","context","globalOptions","loaderOptions","fetch","url"],"sources":["../../../../src/lib/loader-utils/get-fetch-function.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderContext, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {isObject} from '../../javascript-utils/is-type';\nimport {fetchFile} from '../fetch/fetch-file';\nimport {getGlobalLoaderOptions} from './option-utils';\n\n/**\n * Gets the current fetch function from options and context\n * @param options\n * @param context\n */\nexport function getFetchFunction(\n options?: LoaderOptions,\n context?: Omit<LoaderContext, 'fetch'> & Partial<Pick<LoaderContext, 'fetch'>>\n) {\n const globalOptions = getGlobalLoaderOptions();\n\n const loaderOptions = options || globalOptions;\n\n // options.fetch can be a function\n if (typeof loaderOptions.fetch === 'function') {\n return loaderOptions.fetch;\n }\n\n // options.fetch can be an options object\n if (isObject(loaderOptions.fetch)) {\n return (url) => fetchFile(url, loaderOptions.fetch as RequestInit);\n }\n\n // else refer to context (from parent loader) if available\n if (context?.fetch) {\n return context?.fetch;\n }\n\n // else return the default fetch function\n return fetchFile;\n}\n"],"mappings":"AAGA,SAAQA,QAAQ,QAAO,gCAAgC;AACvD,SAAQC,SAAS,QAAO,qBAAqB;AAC7C,SAAQC,sBAAsB,QAAO,gBAAgB;AAOrD,OAAO,SAASC,gBAAgBA,CAC9BC,OAAuB,EACvBC,OAA8E,EAC9E;EACA,MAAMC,aAAa,GAAGJ,sBAAsB,CAAC,CAAC;EAE9C,MAAMK,aAAa,GAAGH,OAAO,IAAIE,aAAa;EAG9C,IAAI,OAAOC,aAAa,CAACC,KAAK,KAAK,UAAU,EAAE;IAC7C,OAAOD,aAAa,CAACC,KAAK;EAC5B;EAGA,IAAIR,QAAQ,CAACO,aAAa,CAACC,KAAK,CAAC,EAAE;IACjC,OAAQC,GAAG,IAAKR,SAAS,CAACQ,GAAG,EAAEF,aAAa,CAACC,KAAoB,CAAC;EACpE;EAGA,IAAIH,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEG,KAAK,EAAE;IAClB,OAAOH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEG,KAAK;EACvB;EAGA,OAAOP,SAAS;AAClB"}
@@ -5,6 +5,7 @@ export const DEFAULT_LOADER_OPTIONS = {
5
5
  mimeType: undefined,
6
6
  nothrow: false,
7
7
  log: new ConsoleLog(),
8
+ useLocalLibraries: false,
8
9
  CDN: 'https://unpkg.com/@loaders.gl',
9
10
  worker: true,
10
11
  maxConcurrency: 3,
@@ -1 +1 @@
1
- {"version":3,"file":"option-defaults.js","names":["isBrowser","ConsoleLog","DEFAULT_LOADER_OPTIONS","fetch","mimeType","undefined","nothrow","log","CDN","worker","maxConcurrency","maxMobileConcurrency","reuseWorkers","_nodeWorkers","_workerType","limit","_limitMB","batchSize","batchDebounceMs","metadata","transforms","REMOVED_LOADER_OPTIONS","throws","dataType","uri","method","headers","body","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"],"sources":["../../../../src/lib/loader-utils/option-defaults.ts"],"sourcesContent":["import type {LoaderOptions} from '@loaders.gl/loader-utils';\nimport {isBrowser} from '@loaders.gl/loader-utils';\nimport {ConsoleLog} from './loggers';\n\nexport const DEFAULT_LOADER_OPTIONS: LoaderOptions = {\n // baseUri\n fetch: null,\n mimeType: undefined,\n nothrow: false,\n log: new ConsoleLog(), // A probe.gl compatible (`log.log()()` syntax) that just logs to console\n\n CDN: 'https://unpkg.com/@loaders.gl',\n worker: true, // By default, use worker if provided by loader.\n maxConcurrency: 3, // How many worker instances should be created for each loader.\n maxMobileConcurrency: 1, // How many worker instances should be created for each loader on mobile devices.\n reuseWorkers: isBrowser, // By default reuse workers in browser (Node.js refuses to terminate if browsers are running)\n _nodeWorkers: false, // By default do not support node workers\n _workerType: '', // 'test' to use locally generated workers\n\n limit: 0,\n _limitMB: 0,\n batchSize: 'auto',\n batchDebounceMs: 0,\n metadata: false, // TODO - currently only implemented for parseInBatches, adds initial metadata batch,\n transforms: []\n};\n\nexport const REMOVED_LOADER_OPTIONS = {\n throws: 'nothrow',\n dataType: '(no longer used)',\n uri: 'baseUri',\n // Warn if fetch options are used on top-level\n method: 'fetch.method',\n headers: 'fetch.headers',\n body: 'fetch.body',\n mode: 'fetch.mode',\n credentials: 'fetch.credentials',\n cache: 'fetch.cache',\n redirect: 'fetch.redirect',\n referrer: 'fetch.referrer',\n referrerPolicy: 'fetch.referrerPolicy',\n integrity: 'fetch.integrity',\n keepalive: 'fetch.keepalive',\n signal: 'fetch.signal'\n};\n"],"mappings":"AACA,SAAQA,SAAS,QAAO,0BAA0B;AAClD,SAAQC,UAAU,QAAO,WAAW;AAEpC,OAAO,MAAMC,sBAAqC,GAAG;EAEnDC,KAAK,EAAE,IAAI;EACXC,QAAQ,EAAEC,SAAS;EACnBC,OAAO,EAAE,KAAK;EACdC,GAAG,EAAE,IAAIN,UAAU,CAAC,CAAC;EAErBO,GAAG,EAAE,+BAA+B;EACpCC,MAAM,EAAE,IAAI;EACZC,cAAc,EAAE,CAAC;EACjBC,oBAAoB,EAAE,CAAC;EACvBC,YAAY,EAAEZ,SAAS;EACvBa,YAAY,EAAE,KAAK;EACnBC,WAAW,EAAE,EAAE;EAEfC,KAAK,EAAE,CAAC;EACRC,QAAQ,EAAE,CAAC;EACXC,SAAS,EAAE,MAAM;EACjBC,eAAe,EAAE,CAAC;EAClBC,QAAQ,EAAE,KAAK;EACfC,UAAU,EAAE;AACd,CAAC;AAED,OAAO,MAAMC,sBAAsB,GAAG;EACpCC,MAAM,EAAE,SAAS;EACjBC,QAAQ,EAAE,kBAAkB;EAC5BC,GAAG,EAAE,SAAS;EAEdC,MAAM,EAAE,cAAc;EACtBC,OAAO,EAAE,eAAe;EACxBC,IAAI,EAAE,YAAY;EAClBC,IAAI,EAAE,YAAY;EAClBC,WAAW,EAAE,mBAAmB;EAChCC,KAAK,EAAE,aAAa;EACpBC,QAAQ,EAAE,gBAAgB;EAC1BC,QAAQ,EAAE,gBAAgB;EAC1BC,cAAc,EAAE,sBAAsB;EACtCC,SAAS,EAAE,iBAAiB;EAC5BC,SAAS,EAAE,iBAAiB;EAC5BC,MAAM,EAAE;AACV,CAAC"}
1
+ {"version":3,"file":"option-defaults.js","names":["isBrowser","ConsoleLog","DEFAULT_LOADER_OPTIONS","fetch","mimeType","undefined","nothrow","log","useLocalLibraries","CDN","worker","maxConcurrency","maxMobileConcurrency","reuseWorkers","_nodeWorkers","_workerType","limit","_limitMB","batchSize","batchDebounceMs","metadata","transforms","REMOVED_LOADER_OPTIONS","throws","dataType","uri","method","headers","body","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"],"sources":["../../../../src/lib/loader-utils/option-defaults.ts"],"sourcesContent":["import type {LoaderOptions} from '@loaders.gl/loader-utils';\nimport {isBrowser} from '@loaders.gl/loader-utils';\nimport {ConsoleLog} from './loggers';\n\nexport const DEFAULT_LOADER_OPTIONS: LoaderOptions = {\n // baseUri\n fetch: null,\n mimeType: undefined,\n nothrow: false,\n log: new ConsoleLog(), // A probe.gl compatible (`log.log()()` syntax) that just logs to console\n useLocalLibraries: false,\n\n CDN: 'https://unpkg.com/@loaders.gl',\n worker: true, // By default, use worker if provided by loader.\n maxConcurrency: 3, // How many worker instances should be created for each loader.\n maxMobileConcurrency: 1, // How many worker instances should be created for each loader on mobile devices.\n reuseWorkers: isBrowser, // By default reuse workers in browser (Node.js refuses to terminate if browsers are running)\n _nodeWorkers: false, // By default do not support node workers\n _workerType: '', // 'test' to use locally generated workers\n\n limit: 0,\n _limitMB: 0,\n batchSize: 'auto',\n batchDebounceMs: 0,\n metadata: false, // TODO - currently only implemented for parseInBatches, adds initial metadata batch,\n transforms: []\n};\n\nexport const REMOVED_LOADER_OPTIONS = {\n throws: 'nothrow',\n dataType: '(no longer used)',\n uri: 'baseUri',\n // Warn if fetch options are used on top-level\n method: 'fetch.method',\n headers: 'fetch.headers',\n body: 'fetch.body',\n mode: 'fetch.mode',\n credentials: 'fetch.credentials',\n cache: 'fetch.cache',\n redirect: 'fetch.redirect',\n referrer: 'fetch.referrer',\n referrerPolicy: 'fetch.referrerPolicy',\n integrity: 'fetch.integrity',\n keepalive: 'fetch.keepalive',\n signal: 'fetch.signal'\n};\n"],"mappings":"AACA,SAAQA,SAAS,QAAO,0BAA0B;AAClD,SAAQC,UAAU,QAAO,WAAW;AAEpC,OAAO,MAAMC,sBAAqC,GAAG;EAEnDC,KAAK,EAAE,IAAI;EACXC,QAAQ,EAAEC,SAAS;EACnBC,OAAO,EAAE,KAAK;EACdC,GAAG,EAAE,IAAIN,UAAU,CAAC,CAAC;EACrBO,iBAAiB,EAAE,KAAK;EAExBC,GAAG,EAAE,+BAA+B;EACpCC,MAAM,EAAE,IAAI;EACZC,cAAc,EAAE,CAAC;EACjBC,oBAAoB,EAAE,CAAC;EACvBC,YAAY,EAAEb,SAAS;EACvBc,YAAY,EAAE,KAAK;EACnBC,WAAW,EAAE,EAAE;EAEfC,KAAK,EAAE,CAAC;EACRC,QAAQ,EAAE,CAAC;EACXC,SAAS,EAAE,MAAM;EACjBC,eAAe,EAAE,CAAC;EAClBC,QAAQ,EAAE,KAAK;EACfC,UAAU,EAAE;AACd,CAAC;AAED,OAAO,MAAMC,sBAAsB,GAAG;EACpCC,MAAM,EAAE,SAAS;EACjBC,QAAQ,EAAE,kBAAkB;EAC5BC,GAAG,EAAE,SAAS;EAEdC,MAAM,EAAE,cAAc;EACtBC,OAAO,EAAE,eAAe;EACxBC,IAAI,EAAE,YAAY;EAClBC,IAAI,EAAE,YAAY;EAClBC,WAAW,EAAE,mBAAmB;EAChCC,KAAK,EAAE,aAAa;EACpBC,QAAQ,EAAE,gBAAgB;EAC1BC,QAAQ,EAAE,gBAAgB;EAC1BC,cAAc,EAAE,sBAAsB;EACtCC,SAAS,EAAE,iBAAiB;EAC5BC,SAAS,EAAE,iBAAiB;EAC5BC,MAAM,EAAE;AACV,CAAC"}
@@ -1,4 +1,4 @@
1
- const VERSION = typeof "4.0.0-alpha.18" !== 'undefined' ? "4.0.0-alpha.18" : 'latest';
1
+ const VERSION = typeof "4.0.0-alpha.20" !== 'undefined' ? "4.0.0-alpha.20" : 'latest';
2
2
  export const NullWorkerLoader = {
3
3
  name: 'Null loader',
4
4
  id: 'null',
@@ -12,14 +12,14 @@ const option_utils_1 = require("./option-utils");
12
12
  */
13
13
  function getFetchFunction(options, context) {
14
14
  const globalOptions = (0, option_utils_1.getGlobalLoaderOptions)();
15
- const fetchOptions = options || globalOptions;
15
+ const loaderOptions = options || globalOptions;
16
16
  // options.fetch can be a function
17
- if (typeof fetchOptions.fetch === 'function') {
18
- return fetchOptions.fetch;
17
+ if (typeof loaderOptions.fetch === 'function') {
18
+ return loaderOptions.fetch;
19
19
  }
20
20
  // options.fetch can be an options object
21
- if ((0, is_type_1.isObject)(fetchOptions.fetch)) {
22
- return (url) => (0, fetch_file_1.fetchFile)(url, fetchOptions);
21
+ if ((0, is_type_1.isObject)(loaderOptions.fetch)) {
22
+ return (url) => (0, fetch_file_1.fetchFile)(url, loaderOptions.fetch);
23
23
  }
24
24
  // else refer to context (from parent loader) if available
25
25
  if (context?.fetch) {
@@ -1 +1 @@
1
- {"version":3,"file":"option-defaults.d.ts","sourceRoot":"","sources":["../../../src/lib/loader-utils/option-defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAI5D,eAAO,MAAM,sBAAsB,EAAE,aAqBpC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;CAiBlC,CAAC"}
1
+ {"version":3,"file":"option-defaults.d.ts","sourceRoot":"","sources":["../../../src/lib/loader-utils/option-defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAI5D,eAAO,MAAM,sBAAsB,EAAE,aAsBpC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;CAiBlC,CAAC"}
@@ -9,6 +9,7 @@ exports.DEFAULT_LOADER_OPTIONS = {
9
9
  mimeType: undefined,
10
10
  nothrow: false,
11
11
  log: new loggers_1.ConsoleLog(),
12
+ useLocalLibraries: false,
12
13
  CDN: 'https://unpkg.com/@loaders.gl',
13
14
  worker: true,
14
15
  maxConcurrency: 3,
@@ -201,7 +201,7 @@ async function parseData({ loader, arrayBuffer, options, context }) {
201
201
  }
202
202
 
203
203
  // src/null-loader.ts
204
- var VERSION = true ? "4.0.0-alpha.18" : "latest";
204
+ var VERSION = true ? "4.0.0-alpha.20" : "latest";
205
205
  function parseSync(arrayBuffer, options, context) {
206
206
  if (!options.null.echoParameters)
207
207
  return null;
@@ -184,7 +184,7 @@
184
184
  }
185
185
 
186
186
  // src/null-loader.ts
187
- var VERSION = true ? "4.0.0-alpha.18" : "latest";
187
+ var VERSION = true ? "4.0.0-alpha.20" : "latest";
188
188
  function parseSync(arrayBuffer, options, context) {
189
189
  if (!options.null.echoParameters)
190
190
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/core",
3
- "version": "4.0.0-alpha.18",
3
+ "version": "4.0.0-alpha.20",
4
4
  "description": "The core API for working with loaders.gl loaders and writers",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -47,9 +47,9 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@babel/runtime": "^7.3.1",
50
- "@loaders.gl/loader-utils": "4.0.0-alpha.18",
51
- "@loaders.gl/worker-utils": "4.0.0-alpha.18",
50
+ "@loaders.gl/loader-utils": "4.0.0-alpha.20",
51
+ "@loaders.gl/worker-utils": "4.0.0-alpha.20",
52
52
  "@probe.gl/log": "^4.0.2"
53
53
  },
54
- "gitHead": "7bc633f46560f661bdd46cf1015ea27b3694ebce"
54
+ "gitHead": "ac122e83102657c38207d59c631a5ce4e7aa46bd"
55
55
  }
@@ -16,16 +16,16 @@ export function getFetchFunction(
16
16
  ) {
17
17
  const globalOptions = getGlobalLoaderOptions();
18
18
 
19
- const fetchOptions = options || globalOptions;
19
+ const loaderOptions = options || globalOptions;
20
20
 
21
21
  // options.fetch can be a function
22
- if (typeof fetchOptions.fetch === 'function') {
23
- return fetchOptions.fetch;
22
+ if (typeof loaderOptions.fetch === 'function') {
23
+ return loaderOptions.fetch;
24
24
  }
25
25
 
26
26
  // options.fetch can be an options object
27
- if (isObject(fetchOptions.fetch)) {
28
- return (url) => fetchFile(url, fetchOptions as RequestInit);
27
+ if (isObject(loaderOptions.fetch)) {
28
+ return (url) => fetchFile(url, loaderOptions.fetch as RequestInit);
29
29
  }
30
30
 
31
31
  // else refer to context (from parent loader) if available
@@ -8,6 +8,7 @@ export const DEFAULT_LOADER_OPTIONS: LoaderOptions = {
8
8
  mimeType: undefined,
9
9
  nothrow: false,
10
10
  log: new ConsoleLog(), // A probe.gl compatible (`log.log()()` syntax) that just logs to console
11
+ useLocalLibraries: false,
11
12
 
12
13
  CDN: 'https://unpkg.com/@loaders.gl',
13
14
  worker: true, // By default, use worker if provided by loader.