@loaders.gl/compression 4.3.0-alpha.8 → 4.3.0-beta.1
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/compress-on-worker.js +1 -1
- package/dist/compression-worker.js +2 -2
- package/dist/compression-worker.js.map +4 -4
- package/dist/dist.dev.js +84 -227
- package/dist/dist.min.js +3 -3
- package/dist/index.cjs +48 -54
- package/dist/index.cjs.map +3 -3
- package/dist/lib/brotli-compression.d.ts.map +1 -1
- package/dist/lib/brotli-compression.js +1 -3
- package/dist/lib/compression.d.ts.map +1 -1
- package/dist/lib/compression.js +1 -2
- package/dist/lib/deflate-compression.d.ts.map +1 -1
- package/dist/lib/deflate-compression.js +1 -2
- package/dist/lib/lz4-compression.d.ts.map +1 -1
- package/dist/lib/lz4-compression.js +1 -2
- package/dist/lib/zstd-compression.d.ts.map +1 -1
- package/dist/lib/zstd-compression.js +1 -2
- package/package.json +4 -4
- package/src/lib/brotli-compression.ts +8 -3
- package/src/lib/compression.ts +1 -2
- package/src/lib/deflate-compression.ts +1 -2
- package/src/lib/lz4-compression.ts +1 -2
- package/src/lib/zstd-compression.ts +6 -2
package/dist/dist.dev.js
CHANGED
|
@@ -4691,85 +4691,37 @@ var __exports__ = (() => {
|
|
|
4691
4691
|
var matches = typeof process !== "undefined" && process.version && /v([0-9]*)/.exec(process.version);
|
|
4692
4692
|
var nodeVersion = matches && parseFloat(matches[1]) || 0;
|
|
4693
4693
|
|
|
4694
|
-
// ../../node_modules/@
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
4701
|
-
}, _typeof(obj);
|
|
4702
|
-
}
|
|
4703
|
-
|
|
4704
|
-
// ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
|
4705
|
-
function _toPrimitive(input, hint) {
|
|
4706
|
-
if (_typeof(input) !== "object" || input === null)
|
|
4707
|
-
return input;
|
|
4708
|
-
var prim = input[Symbol.toPrimitive];
|
|
4709
|
-
if (prim !== void 0) {
|
|
4710
|
-
var res = prim.call(input, hint || "default");
|
|
4711
|
-
if (_typeof(res) !== "object")
|
|
4712
|
-
return res;
|
|
4713
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
4714
|
-
}
|
|
4715
|
-
return (hint === "string" ? String : Number)(input);
|
|
4716
|
-
}
|
|
4717
|
-
|
|
4718
|
-
// ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
|
4719
|
-
function _toPropertyKey(arg) {
|
|
4720
|
-
var key = _toPrimitive(arg, "string");
|
|
4721
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
4722
|
-
}
|
|
4723
|
-
|
|
4724
|
-
// ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
4725
|
-
function _defineProperty(obj, key, value) {
|
|
4726
|
-
key = _toPropertyKey(key);
|
|
4727
|
-
if (key in obj) {
|
|
4728
|
-
Object.defineProperty(obj, key, {
|
|
4729
|
-
value,
|
|
4730
|
-
enumerable: true,
|
|
4731
|
-
configurable: true,
|
|
4732
|
-
writable: true
|
|
4733
|
-
});
|
|
4734
|
-
} else {
|
|
4735
|
-
obj[key] = value;
|
|
4736
|
-
}
|
|
4737
|
-
return obj;
|
|
4738
|
-
}
|
|
4694
|
+
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/globals.js
|
|
4695
|
+
var window_2 = globalThis;
|
|
4696
|
+
var document_2 = globalThis.document || {};
|
|
4697
|
+
var process_ = globalThis.process || {};
|
|
4698
|
+
var console_ = globalThis.console;
|
|
4699
|
+
var navigator_ = globalThis.navigator || {};
|
|
4739
4700
|
|
|
4740
4701
|
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/is-electron.js
|
|
4741
4702
|
function isElectron(mockUserAgent) {
|
|
4742
|
-
if (typeof window !== "undefined" &&
|
|
4703
|
+
if (typeof window !== "undefined" && window.process?.type === "renderer") {
|
|
4743
4704
|
return true;
|
|
4744
4705
|
}
|
|
4745
|
-
if (typeof process !== "undefined" &&
|
|
4706
|
+
if (typeof process !== "undefined" && Boolean(process.versions?.["electron"])) {
|
|
4746
4707
|
return true;
|
|
4747
4708
|
}
|
|
4748
|
-
const realUserAgent = typeof navigator
|
|
4709
|
+
const realUserAgent = typeof navigator !== "undefined" && navigator.userAgent;
|
|
4749
4710
|
const userAgent = mockUserAgent || realUserAgent;
|
|
4750
|
-
|
|
4751
|
-
return true;
|
|
4752
|
-
}
|
|
4753
|
-
return false;
|
|
4711
|
+
return Boolean(userAgent && userAgent.indexOf("Electron") >= 0);
|
|
4754
4712
|
}
|
|
4755
4713
|
|
|
4756
4714
|
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/is-browser.js
|
|
4757
4715
|
function isBrowser2() {
|
|
4758
|
-
const isNode =
|
|
4716
|
+
const isNode = (
|
|
4717
|
+
// @ts-expect-error
|
|
4718
|
+
typeof process === "object" && String(process) === "[object process]" && !process?.browser
|
|
4719
|
+
);
|
|
4759
4720
|
return !isNode || isElectron();
|
|
4760
4721
|
}
|
|
4761
4722
|
|
|
4762
|
-
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/
|
|
4763
|
-
var
|
|
4764
|
-
var window_2 = globalThis.window || globalThis.self || globalThis.global;
|
|
4765
|
-
var document_2 = globalThis.document || {};
|
|
4766
|
-
var process_ = globalThis.process || {};
|
|
4767
|
-
var console_ = globalThis.console;
|
|
4768
|
-
var navigator_ = globalThis.navigator || {};
|
|
4769
|
-
|
|
4770
|
-
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/utils/globals.js
|
|
4771
|
-
var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
4772
|
-
var isBrowser3 = isBrowser2();
|
|
4723
|
+
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/index.js
|
|
4724
|
+
var VERSION = true ? "4.0.7" : "untranspiled source";
|
|
4773
4725
|
|
|
4774
4726
|
// ../../node_modules/@probe.gl/log/dist/utils/local-storage.js
|
|
4775
4727
|
function getStorage(type) {
|
|
@@ -4784,11 +4736,7 @@ var __exports__ = (() => {
|
|
|
4784
4736
|
}
|
|
4785
4737
|
}
|
|
4786
4738
|
var LocalStorage = class {
|
|
4787
|
-
constructor(id, defaultConfig) {
|
|
4788
|
-
let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
|
|
4789
|
-
_defineProperty(this, "storage", void 0);
|
|
4790
|
-
_defineProperty(this, "id", void 0);
|
|
4791
|
-
_defineProperty(this, "config", void 0);
|
|
4739
|
+
constructor(id, defaultConfig, type = "sessionStorage") {
|
|
4792
4740
|
this.storage = getStorage(type);
|
|
4793
4741
|
this.id = id;
|
|
4794
4742
|
this.config = defaultConfig;
|
|
@@ -4804,6 +4752,7 @@ var __exports__ = (() => {
|
|
|
4804
4752
|
this.storage.setItem(this.id, serialized);
|
|
4805
4753
|
}
|
|
4806
4754
|
}
|
|
4755
|
+
// Get config from persistent store, if available
|
|
4807
4756
|
_loadConfiguration() {
|
|
4808
4757
|
let configuration = {};
|
|
4809
4758
|
if (this.storage) {
|
|
@@ -4819,31 +4768,19 @@ var __exports__ = (() => {
|
|
|
4819
4768
|
function formatTime(ms) {
|
|
4820
4769
|
let formatted;
|
|
4821
4770
|
if (ms < 10) {
|
|
4822
|
-
formatted =
|
|
4771
|
+
formatted = `${ms.toFixed(2)}ms`;
|
|
4823
4772
|
} else if (ms < 100) {
|
|
4824
|
-
formatted =
|
|
4773
|
+
formatted = `${ms.toFixed(1)}ms`;
|
|
4825
4774
|
} else if (ms < 1e3) {
|
|
4826
|
-
formatted =
|
|
4775
|
+
formatted = `${ms.toFixed(0)}ms`;
|
|
4827
4776
|
} else {
|
|
4828
|
-
formatted =
|
|
4777
|
+
formatted = `${(ms / 1e3).toFixed(2)}s`;
|
|
4829
4778
|
}
|
|
4830
4779
|
return formatted;
|
|
4831
4780
|
}
|
|
4832
|
-
function leftPad(string) {
|
|
4833
|
-
let length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
|
|
4781
|
+
function leftPad(string, length = 8) {
|
|
4834
4782
|
const padLength = Math.max(length - string.length, 0);
|
|
4835
|
-
return "
|
|
4836
|
-
}
|
|
4837
|
-
function formatImage(image, message, scale) {
|
|
4838
|
-
let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
|
|
4839
|
-
const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
|
|
4840
|
-
if (image.width > maxWidth) {
|
|
4841
|
-
scale = Math.min(scale, maxWidth / image.width);
|
|
4842
|
-
}
|
|
4843
|
-
const width = image.width * scale;
|
|
4844
|
-
const height = image.height * scale;
|
|
4845
|
-
const style = ["font-size:1px;", "padding:".concat(Math.floor(height / 2), "px ").concat(Math.floor(width / 2), "px;"), "line-height:".concat(height, "px;"), "background:url(".concat(imageUrl, ");"), "background-size:".concat(width, "px ").concat(height, "px;"), "color:transparent;"].join("");
|
|
4846
|
-
return ["".concat(message, " %c+"), style];
|
|
4783
|
+
return `${" ".repeat(padLength)}${string}`;
|
|
4847
4784
|
}
|
|
4848
4785
|
|
|
4849
4786
|
// ../../node_modules/@probe.gl/log/dist/utils/color.js
|
|
@@ -4878,19 +4815,18 @@ var __exports__ = (() => {
|
|
|
4878
4815
|
if (!isBrowser2 && typeof string === "string") {
|
|
4879
4816
|
if (color) {
|
|
4880
4817
|
const colorCode = getColor(color);
|
|
4881
|
-
string =
|
|
4818
|
+
string = `\x1B[${colorCode}m${string}\x1B[39m`;
|
|
4882
4819
|
}
|
|
4883
4820
|
if (background) {
|
|
4884
4821
|
const colorCode = getColor(background);
|
|
4885
|
-
string =
|
|
4822
|
+
string = `\x1B[${colorCode + BACKGROUND_INCREMENT}m${string}\x1B[49m`;
|
|
4886
4823
|
}
|
|
4887
4824
|
}
|
|
4888
4825
|
return string;
|
|
4889
4826
|
}
|
|
4890
4827
|
|
|
4891
4828
|
// ../../node_modules/@probe.gl/log/dist/utils/autobind.js
|
|
4892
|
-
function autobind(obj) {
|
|
4893
|
-
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
4829
|
+
function autobind(obj, predefined = ["constructor"]) {
|
|
4894
4830
|
const proto = Object.getPrototypeOf(obj);
|
|
4895
4831
|
const propNames = Object.getOwnPropertyNames(proto);
|
|
4896
4832
|
const object = obj;
|
|
@@ -4915,11 +4851,9 @@ var __exports__ = (() => {
|
|
|
4915
4851
|
function getHiResTimestamp() {
|
|
4916
4852
|
let timestamp;
|
|
4917
4853
|
if (isBrowser2() && window_2.performance) {
|
|
4918
|
-
|
|
4919
|
-
timestamp = window_2 === null || window_2 === void 0 ? void 0 : (_window$performance = window_2.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
|
|
4854
|
+
timestamp = window_2?.performance?.now?.();
|
|
4920
4855
|
} else if ("hrtime" in process_) {
|
|
4921
|
-
|
|
4922
|
-
const timeParts = process_ === null || process_ === void 0 ? void 0 : (_process$hrtime = process_.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_);
|
|
4856
|
+
const timeParts = process_?.hrtime?.();
|
|
4923
4857
|
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
4924
4858
|
} else {
|
|
4925
4859
|
timestamp = Date.now();
|
|
@@ -4942,27 +4876,18 @@ var __exports__ = (() => {
|
|
|
4942
4876
|
function noop() {
|
|
4943
4877
|
}
|
|
4944
4878
|
var cache = {};
|
|
4945
|
-
var ONCE = {
|
|
4946
|
-
once: true
|
|
4947
|
-
};
|
|
4879
|
+
var ONCE = { once: true };
|
|
4948
4880
|
var Log = class {
|
|
4949
|
-
constructor() {
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
_defineProperty(this, "id", void 0);
|
|
4956
|
-
_defineProperty(this, "VERSION", VERSION);
|
|
4957
|
-
_defineProperty(this, "_startTs", getHiResTimestamp());
|
|
4958
|
-
_defineProperty(this, "_deltaTs", getHiResTimestamp());
|
|
4959
|
-
_defineProperty(this, "_storage", void 0);
|
|
4960
|
-
_defineProperty(this, "userData", {});
|
|
4961
|
-
_defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
|
|
4881
|
+
constructor({ id } = { id: "" }) {
|
|
4882
|
+
this.VERSION = VERSION;
|
|
4883
|
+
this._startTs = getHiResTimestamp();
|
|
4884
|
+
this._deltaTs = getHiResTimestamp();
|
|
4885
|
+
this.userData = {};
|
|
4886
|
+
this.LOG_THROTTLE_TIMEOUT = 0;
|
|
4962
4887
|
this.id = id;
|
|
4963
4888
|
this.userData = {};
|
|
4964
|
-
this._storage = new LocalStorage(
|
|
4965
|
-
this.timeStamp(
|
|
4889
|
+
this._storage = new LocalStorage(`__probe-${this.id}__`, DEFAULT_LOG_CONFIGURATION);
|
|
4890
|
+
this.timeStamp(`${this.id} started`);
|
|
4966
4891
|
autobind(this);
|
|
4967
4892
|
Object.seal(this);
|
|
4968
4893
|
}
|
|
@@ -4978,42 +4903,44 @@ var __exports__ = (() => {
|
|
|
4978
4903
|
getLevel() {
|
|
4979
4904
|
return this._storage.config.level;
|
|
4980
4905
|
}
|
|
4906
|
+
/** @return milliseconds, with fractions */
|
|
4981
4907
|
getTotal() {
|
|
4982
4908
|
return Number((getHiResTimestamp() - this._startTs).toPrecision(10));
|
|
4983
4909
|
}
|
|
4910
|
+
/** @return milliseconds, with fractions */
|
|
4984
4911
|
getDelta() {
|
|
4985
4912
|
return Number((getHiResTimestamp() - this._deltaTs).toPrecision(10));
|
|
4986
4913
|
}
|
|
4914
|
+
/** @deprecated use logLevel */
|
|
4987
4915
|
set priority(newPriority) {
|
|
4988
4916
|
this.level = newPriority;
|
|
4989
4917
|
}
|
|
4918
|
+
/** @deprecated use logLevel */
|
|
4990
4919
|
get priority() {
|
|
4991
4920
|
return this.level;
|
|
4992
4921
|
}
|
|
4922
|
+
/** @deprecated use logLevel */
|
|
4993
4923
|
getPriority() {
|
|
4994
4924
|
return this.level;
|
|
4995
4925
|
}
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
this._storage.setConfiguration({
|
|
4999
|
-
enabled
|
|
5000
|
-
});
|
|
4926
|
+
// Configure
|
|
4927
|
+
enable(enabled = true) {
|
|
4928
|
+
this._storage.setConfiguration({ enabled });
|
|
5001
4929
|
return this;
|
|
5002
4930
|
}
|
|
5003
4931
|
setLevel(level) {
|
|
5004
|
-
this._storage.setConfiguration({
|
|
5005
|
-
level
|
|
5006
|
-
});
|
|
4932
|
+
this._storage.setConfiguration({ level });
|
|
5007
4933
|
return this;
|
|
5008
4934
|
}
|
|
4935
|
+
/** return the current status of the setting */
|
|
5009
4936
|
get(setting) {
|
|
5010
4937
|
return this._storage.config[setting];
|
|
5011
4938
|
}
|
|
4939
|
+
// update the status of the setting
|
|
5012
4940
|
set(setting, value) {
|
|
5013
|
-
this._storage.setConfiguration({
|
|
5014
|
-
[setting]: value
|
|
5015
|
-
});
|
|
4941
|
+
this._storage.setConfiguration({ [setting]: value });
|
|
5016
4942
|
}
|
|
4943
|
+
/** Logs the current settings as a table */
|
|
5017
4944
|
settings() {
|
|
5018
4945
|
if (console.table) {
|
|
5019
4946
|
console.table(this._storage.config);
|
|
@@ -5021,8 +4948,11 @@ var __exports__ = (() => {
|
|
|
5021
4948
|
console.log(this._storage.config);
|
|
5022
4949
|
}
|
|
5023
4950
|
}
|
|
4951
|
+
// Unconditional logging
|
|
5024
4952
|
assert(condition, message) {
|
|
5025
|
-
|
|
4953
|
+
if (!condition) {
|
|
4954
|
+
throw new Error(message || "Assertion failed");
|
|
4955
|
+
}
|
|
5026
4956
|
}
|
|
5027
4957
|
warn(message) {
|
|
5028
4958
|
return this._getLogFunction(0, message, originalConsole.warn, arguments, ONCE);
|
|
@@ -5030,11 +4960,13 @@ var __exports__ = (() => {
|
|
|
5030
4960
|
error(message) {
|
|
5031
4961
|
return this._getLogFunction(0, message, originalConsole.error, arguments);
|
|
5032
4962
|
}
|
|
4963
|
+
/** Print a deprecation warning */
|
|
5033
4964
|
deprecated(oldUsage, newUsage) {
|
|
5034
|
-
return this.warn(
|
|
4965
|
+
return this.warn(`\`${oldUsage}\` is deprecated and will be removed in a later version. Use \`${newUsage}\` instead`);
|
|
5035
4966
|
}
|
|
4967
|
+
/** Print a removal warning */
|
|
5036
4968
|
removed(oldUsage, newUsage) {
|
|
5037
|
-
return this.error(
|
|
4969
|
+
return this.error(`\`${oldUsage}\` has been removed. Use \`${newUsage}\` instead`);
|
|
5038
4970
|
}
|
|
5039
4971
|
probe(logLevel, message) {
|
|
5040
4972
|
return this._getLogFunction(logLevel, message, originalConsole.log, arguments, {
|
|
@@ -5051,6 +4983,7 @@ var __exports__ = (() => {
|
|
|
5051
4983
|
once(logLevel, message) {
|
|
5052
4984
|
return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
|
|
5053
4985
|
}
|
|
4986
|
+
/** Logs an object as a table */
|
|
5054
4987
|
table(logLevel, table, columns) {
|
|
5055
4988
|
if (table) {
|
|
5056
4989
|
return this._getLogFunction(logLevel, table, console.table || noop, columns && [columns], {
|
|
@@ -5059,27 +4992,6 @@ var __exports__ = (() => {
|
|
|
5059
4992
|
}
|
|
5060
4993
|
return noop;
|
|
5061
4994
|
}
|
|
5062
|
-
image(_ref) {
|
|
5063
|
-
let {
|
|
5064
|
-
logLevel,
|
|
5065
|
-
priority,
|
|
5066
|
-
image,
|
|
5067
|
-
message = "",
|
|
5068
|
-
scale = 1
|
|
5069
|
-
} = _ref;
|
|
5070
|
-
if (!this._shouldLog(logLevel || priority)) {
|
|
5071
|
-
return noop;
|
|
5072
|
-
}
|
|
5073
|
-
return isBrowser2() ? logImageInBrowser({
|
|
5074
|
-
image,
|
|
5075
|
-
message,
|
|
5076
|
-
scale
|
|
5077
|
-
}) : logImageInNode({
|
|
5078
|
-
image,
|
|
5079
|
-
message,
|
|
5080
|
-
scale
|
|
5081
|
-
});
|
|
5082
|
-
}
|
|
5083
4995
|
time(logLevel, message) {
|
|
5084
4996
|
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
5085
4997
|
}
|
|
@@ -5089,30 +5001,19 @@ var __exports__ = (() => {
|
|
|
5089
5001
|
timeStamp(logLevel, message) {
|
|
5090
5002
|
return this._getLogFunction(logLevel, message, console.timeStamp || noop);
|
|
5091
5003
|
}
|
|
5092
|
-
group(logLevel, message) {
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
};
|
|
5096
|
-
const options = normalizeArguments({
|
|
5097
|
-
logLevel,
|
|
5098
|
-
message,
|
|
5099
|
-
opts
|
|
5100
|
-
});
|
|
5101
|
-
const {
|
|
5102
|
-
collapsed
|
|
5103
|
-
} = opts;
|
|
5004
|
+
group(logLevel, message, opts = { collapsed: false }) {
|
|
5005
|
+
const options = normalizeArguments({ logLevel, message, opts });
|
|
5006
|
+
const { collapsed } = opts;
|
|
5104
5007
|
options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
5105
5008
|
return this._getLogFunction(options);
|
|
5106
5009
|
}
|
|
5107
|
-
groupCollapsed(logLevel, message) {
|
|
5108
|
-
|
|
5109
|
-
return this.group(logLevel, message, Object.assign({}, opts, {
|
|
5110
|
-
collapsed: true
|
|
5111
|
-
}));
|
|
5010
|
+
groupCollapsed(logLevel, message, opts = {}) {
|
|
5011
|
+
return this.group(logLevel, message, Object.assign({}, opts, { collapsed: true }));
|
|
5112
5012
|
}
|
|
5113
5013
|
groupEnd(logLevel) {
|
|
5114
5014
|
return this._getLogFunction(logLevel, "", console.groupEnd || noop);
|
|
5115
5015
|
}
|
|
5016
|
+
// EXPERIMENTAL
|
|
5116
5017
|
withGroup(logLevel, message, func) {
|
|
5117
5018
|
this.group(logLevel, message)();
|
|
5118
5019
|
try {
|
|
@@ -5126,17 +5027,14 @@ var __exports__ = (() => {
|
|
|
5126
5027
|
console.trace();
|
|
5127
5028
|
}
|
|
5128
5029
|
}
|
|
5030
|
+
// PRIVATE METHODS
|
|
5031
|
+
/** Deduces log level from a variety of arguments */
|
|
5129
5032
|
_shouldLog(logLevel) {
|
|
5130
5033
|
return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);
|
|
5131
5034
|
}
|
|
5132
5035
|
_getLogFunction(logLevel, message, method, args, opts) {
|
|
5133
5036
|
if (this._shouldLog(logLevel)) {
|
|
5134
|
-
opts = normalizeArguments({
|
|
5135
|
-
logLevel,
|
|
5136
|
-
message,
|
|
5137
|
-
args,
|
|
5138
|
-
opts
|
|
5139
|
-
});
|
|
5037
|
+
opts = normalizeArguments({ logLevel, message, args, opts });
|
|
5140
5038
|
method = method || opts.method;
|
|
5141
5039
|
assert(method);
|
|
5142
5040
|
opts.total = this.getTotal();
|
|
@@ -5156,7 +5054,7 @@ var __exports__ = (() => {
|
|
|
5156
5054
|
return noop;
|
|
5157
5055
|
}
|
|
5158
5056
|
};
|
|
5159
|
-
|
|
5057
|
+
Log.VERSION = VERSION;
|
|
5160
5058
|
function normalizeLogLevel(logLevel) {
|
|
5161
5059
|
if (!logLevel) {
|
|
5162
5060
|
return 0;
|
|
@@ -5176,10 +5074,7 @@ var __exports__ = (() => {
|
|
|
5176
5074
|
return resolvedLevel;
|
|
5177
5075
|
}
|
|
5178
5076
|
function normalizeArguments(opts) {
|
|
5179
|
-
const {
|
|
5180
|
-
logLevel,
|
|
5181
|
-
message
|
|
5182
|
-
} = opts;
|
|
5077
|
+
const { logLevel, message } = opts;
|
|
5183
5078
|
opts.logLevel = normalizeLogLevel(logLevel);
|
|
5184
5079
|
const args = opts.args ? Array.from(opts.args) : [];
|
|
5185
5080
|
while (args.length && args.shift() !== message) {
|
|
@@ -5202,55 +5097,16 @@ var __exports__ = (() => {
|
|
|
5202
5097
|
}
|
|
5203
5098
|
const messageType = typeof opts.message;
|
|
5204
5099
|
assert(messageType === "string" || messageType === "object");
|
|
5205
|
-
return Object.assign(opts, {
|
|
5206
|
-
args
|
|
5207
|
-
}, opts.opts);
|
|
5100
|
+
return Object.assign(opts, { args }, opts.opts);
|
|
5208
5101
|
}
|
|
5209
5102
|
function decorateMessage(id, message, opts) {
|
|
5210
5103
|
if (typeof message === "string") {
|
|
5211
5104
|
const time = opts.time ? leftPad(formatTime(opts.total)) : "";
|
|
5212
|
-
message = opts.time ?
|
|
5105
|
+
message = opts.time ? `${id}: ${time} ${message}` : `${id}: ${message}`;
|
|
5213
5106
|
message = addColor(message, opts.color, opts.background);
|
|
5214
5107
|
}
|
|
5215
5108
|
return message;
|
|
5216
5109
|
}
|
|
5217
|
-
function logImageInNode(_ref2) {
|
|
5218
|
-
let {
|
|
5219
|
-
image,
|
|
5220
|
-
message = "",
|
|
5221
|
-
scale = 1
|
|
5222
|
-
} = _ref2;
|
|
5223
|
-
console.warn("removed");
|
|
5224
|
-
return noop;
|
|
5225
|
-
}
|
|
5226
|
-
function logImageInBrowser(_ref3) {
|
|
5227
|
-
let {
|
|
5228
|
-
image,
|
|
5229
|
-
message = "",
|
|
5230
|
-
scale = 1
|
|
5231
|
-
} = _ref3;
|
|
5232
|
-
if (typeof image === "string") {
|
|
5233
|
-
const img = new Image();
|
|
5234
|
-
img.onload = () => {
|
|
5235
|
-
const args = formatImage(img, message, scale);
|
|
5236
|
-
console.log(...args);
|
|
5237
|
-
};
|
|
5238
|
-
img.src = image;
|
|
5239
|
-
return noop;
|
|
5240
|
-
}
|
|
5241
|
-
const element = image.nodeName || "";
|
|
5242
|
-
if (element.toLowerCase() === "img") {
|
|
5243
|
-
console.log(...formatImage(image, message, scale));
|
|
5244
|
-
return noop;
|
|
5245
|
-
}
|
|
5246
|
-
if (element.toLowerCase() === "canvas") {
|
|
5247
|
-
const img = new Image();
|
|
5248
|
-
img.onload = () => console.log(...formatImage(img, message, scale));
|
|
5249
|
-
img.src = image.toDataURL();
|
|
5250
|
-
return noop;
|
|
5251
|
-
}
|
|
5252
|
-
return noop;
|
|
5253
|
-
}
|
|
5254
5110
|
function getTableHeader(table) {
|
|
5255
5111
|
for (const key in table) {
|
|
5256
5112
|
for (const title in table[key]) {
|
|
@@ -5260,10 +5116,11 @@ var __exports__ = (() => {
|
|
|
5260
5116
|
return "empty";
|
|
5261
5117
|
}
|
|
5262
5118
|
|
|
5119
|
+
// ../../node_modules/@probe.gl/log/dist/init.js
|
|
5120
|
+
globalThis.probe = {};
|
|
5121
|
+
|
|
5263
5122
|
// ../../node_modules/@probe.gl/log/dist/index.js
|
|
5264
|
-
var dist_default = new Log({
|
|
5265
|
-
id: "@probe.gl/log"
|
|
5266
|
-
});
|
|
5123
|
+
var dist_default = new Log({ id: "@probe.gl/log" });
|
|
5267
5124
|
|
|
5268
5125
|
// ../loader-utils/src/lib/log-utils/log.ts
|
|
5269
5126
|
var VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
@@ -5335,11 +5192,11 @@ var __exports__ = (() => {
|
|
|
5335
5192
|
global: typeof global !== "undefined" && global,
|
|
5336
5193
|
document: typeof document !== "undefined" && document
|
|
5337
5194
|
};
|
|
5338
|
-
var
|
|
5195
|
+
var self_2 = globals2.self || globals2.window || globals2.global || {};
|
|
5339
5196
|
var window_3 = globals2.window || globals2.self || globals2.global || {};
|
|
5340
5197
|
var global_3 = globals2.global || globals2.self || globals2.window || {};
|
|
5341
5198
|
var document_3 = globals2.document || {};
|
|
5342
|
-
var
|
|
5199
|
+
var isBrowser3 = (
|
|
5343
5200
|
// @ts-ignore process.browser
|
|
5344
5201
|
typeof process !== "object" || String(process) !== "[object process]" || process.browser
|
|
5345
5202
|
);
|
|
@@ -5505,7 +5362,7 @@ var __exports__ = (() => {
|
|
|
5505
5362
|
_loadableURL = "";
|
|
5506
5363
|
/** Checks if workers are supported on this platform */
|
|
5507
5364
|
static isSupported() {
|
|
5508
|
-
return typeof Worker !== "undefined" &&
|
|
5365
|
+
return typeof Worker !== "undefined" && isBrowser3 || typeof NodeWorker !== "undefined" && !isBrowser3;
|
|
5509
5366
|
}
|
|
5510
5367
|
constructor(props) {
|
|
5511
5368
|
const { name, source, url } = props;
|
|
@@ -5515,7 +5372,7 @@ var __exports__ = (() => {
|
|
|
5515
5372
|
this.url = url;
|
|
5516
5373
|
this.onMessage = NOOP;
|
|
5517
5374
|
this.onError = (error) => console.log(error);
|
|
5518
|
-
this.worker =
|
|
5375
|
+
this.worker = isBrowser3 ? this._createBrowserWorker() : this._createNodeWorker();
|
|
5519
5376
|
}
|
|
5520
5377
|
/**
|
|
5521
5378
|
* Terminate this worker thread
|
|
@@ -5711,7 +5568,7 @@ var __exports__ = (() => {
|
|
|
5711
5568
|
const shouldDestroyWorker = (
|
|
5712
5569
|
// Workers on Node.js prevent the process from exiting.
|
|
5713
5570
|
// Until we figure out how to close them before exit, we always destroy them
|
|
5714
|
-
!
|
|
5571
|
+
!isBrowser3 || // If the pool is destroyed, there is no reason to keep the worker around
|
|
5715
5572
|
this.isDestroyed || // If the app has disabled worker reuse, any completed workers should be destroyed
|
|
5716
5573
|
!this.reuseWorkers || // If concurrency has been lowered, this worker might be surplus to requirements
|
|
5717
5574
|
this.count > this._getMaxConcurrency()
|
|
@@ -5835,13 +5692,13 @@ var __exports__ = (() => {
|
|
|
5835
5692
|
}
|
|
5836
5693
|
function getWorkerURL(worker, options = {}) {
|
|
5837
5694
|
const workerOptions = options[worker.id] || {};
|
|
5838
|
-
const workerFile =
|
|
5695
|
+
const workerFile = isBrowser3 ? `${worker.id}-worker.js` : `${worker.id}-worker-node.js`;
|
|
5839
5696
|
let url = workerOptions.workerUrl;
|
|
5840
5697
|
if (!url && worker.id === "compression") {
|
|
5841
5698
|
url = options.workerUrl;
|
|
5842
5699
|
}
|
|
5843
5700
|
if (options._workerType === "test") {
|
|
5844
|
-
if (
|
|
5701
|
+
if (isBrowser3) {
|
|
5845
5702
|
url = `modules/${worker.module}/dist/${workerFile}`;
|
|
5846
5703
|
} else {
|
|
5847
5704
|
url = `modules/${worker.module}/src/workers/${worker.id}-worker-node.ts`;
|