@gjsify/abort-controller 0.0.3 → 0.0.4

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/test.node.mjs CHANGED
@@ -1,31 +1,8 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
2
  var __export = (target, all) => {
4
3
  for (var name in all)
5
4
  __defProp(target, name, { get: all[name], enumerable: true });
6
5
  };
7
- var __publicField = (obj, key, value) => {
8
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
9
- return value;
10
- };
11
- var __accessCheck = (obj, member, msg) => {
12
- if (!member.has(obj))
13
- throw TypeError("Cannot " + msg);
14
- };
15
- var __privateGet = (obj, member, getter) => {
16
- __accessCheck(obj, member, "read from private field");
17
- return getter ? getter.call(obj) : member.get(obj);
18
- };
19
- var __privateAdd = (obj, member, value) => {
20
- if (member.has(obj))
21
- throw TypeError("Cannot add the same private member more than once");
22
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
23
- };
24
- var __privateSet = (obj, member, value, setter) => {
25
- __accessCheck(obj, member, "write to private field");
26
- setter ? setter.call(obj, value) : member.set(obj, value);
27
- return value;
28
- };
29
6
 
30
7
  // ../../../node_modules/@girs/gjs/gjs.js
31
8
  var imports2 = globalThis.imports || {};
@@ -43,14 +20,14 @@ var BLUE = "\x1B[34m";
43
20
  var GRAY = "\x1B[90m";
44
21
  var RESET = "\x1B[39m";
45
22
  var print2 = globalThis.print || console.log;
46
- var MatcherFactory = class {
23
+ var MatcherFactory = class _MatcherFactory {
47
24
  constructor(actualValue, positive, negated) {
48
25
  this.actualValue = actualValue;
49
26
  this.positive = positive;
50
27
  if (negated) {
51
28
  this.not = negated;
52
29
  } else {
53
- this.not = new MatcherFactory(actualValue, !positive, this);
30
+ this.not = new _MatcherFactory(actualValue, !positive, this);
54
31
  }
55
32
  }
56
33
  not;
@@ -869,7 +846,8 @@ var reconstructErrorFromMessage = (errorMessage) => {
869
846
  stackTraceLines
870
847
  };
871
848
  };
872
- var _LogSignals = class {
849
+ var LogSignals = class _LogSignals {
850
+ static instance;
873
851
  /** This is a singleton because log_set_writer_func may only be called once */
874
852
  constructor() {
875
853
  this.initHandler();
@@ -929,8 +907,6 @@ var _LogSignals = class {
929
907
  return false;
930
908
  }
931
909
  };
932
- var LogSignals = _LogSignals;
933
- __publicField(LogSignals, "instance");
934
910
  imports.signals.addSignalMethods(LogSignals.prototype);
935
911
  var logSignals = LogSignals.getSingleton();
936
912
 
@@ -1900,7 +1876,7 @@ ObjectSetPrototypeOf(primordials, null);
1900
1876
  ObjectFreeze(primordials);
1901
1877
 
1902
1878
  // ../../gjs/gio-2.0/lib/esm/file-enumerator.js
1903
- var ExtFileEnumerator = class extends gio_2_0_default.FileEnumerator {
1879
+ var ExtFileEnumerator = class _ExtFileEnumerator extends gio_2_0_default.FileEnumerator {
1904
1880
  /**
1905
1881
  * Creates a new instance of `ExtFileEnumerator` extended on a existing `Gio.FileEnumerator` instance.
1906
1882
  * @param file The original unextended `ExtFileEnumerator`
@@ -1908,8 +1884,8 @@ var ExtFileEnumerator = class extends gio_2_0_default.FileEnumerator {
1908
1884
  */
1909
1885
  static extend(enumerator) {
1910
1886
  const extEnumerator = enumerator;
1911
- extEnumerator.nextFilesAsync = ExtFileEnumerator.prototype.nextFilesAsync.bind(extEnumerator);
1912
- extEnumerator.nextFileAsync = ExtFileEnumerator.prototype.nextFileAsync.bind(extEnumerator);
1887
+ extEnumerator.nextFilesAsync = _ExtFileEnumerator.prototype.nextFilesAsync.bind(extEnumerator);
1888
+ extEnumerator.nextFileAsync = _ExtFileEnumerator.prototype.nextFileAsync.bind(extEnumerator);
1913
1889
  return extEnumerator;
1914
1890
  }
1915
1891
  nextFilesAsync(numFiles, ioPriority = glib_2_0_default.PRIORITY_DEFAULT, cancellable = null) {
@@ -1932,7 +1908,7 @@ var ExtFileEnumerator = class extends gio_2_0_default.FileEnumerator {
1932
1908
  };
1933
1909
 
1934
1910
  // ../../gjs/gio-2.0/lib/esm/file.js
1935
- var ExtFile = class extends gio_2_0_default.File {
1911
+ var ExtFile = class _ExtFile extends gio_2_0_default.File {
1936
1912
  /**
1937
1913
  * Creates a new instance of `ExtFile` extended on a existing `Gio.File` instance.
1938
1914
  * @param file The original unextended `Gio.File`
@@ -1940,13 +1916,13 @@ var ExtFile = class extends gio_2_0_default.File {
1940
1916
  */
1941
1917
  static extend(file) {
1942
1918
  const extFile = file;
1943
- extFile.makeSymbolicLinkAsync = ExtFile.prototype.makeSymbolicLinkAsync.bind(extFile);
1944
- extFile.queryInfoAsync = ExtFile.prototype.queryInfoAsync.bind(extFile);
1945
- extFile.queryFilesystemInfoAsync = ExtFile.prototype.queryFilesystemInfoAsync.bind(extFile);
1946
- extFile.enumerateChildren = ExtFile.prototype.enumerateChildren.bind(extFile);
1947
- extFile.enumerateChildrenAsync = ExtFile.prototype.enumerateChildrenAsync.bind(extFile);
1948
- extFile.loadContents = ExtFile.prototype.loadContents.bind(extFile);
1949
- extFile.loadContentsAsync = ExtFile.prototype.loadContentsAsync.bind(extFile);
1919
+ extFile.makeSymbolicLinkAsync = _ExtFile.prototype.makeSymbolicLinkAsync.bind(extFile);
1920
+ extFile.queryInfoAsync = _ExtFile.prototype.queryInfoAsync.bind(extFile);
1921
+ extFile.queryFilesystemInfoAsync = _ExtFile.prototype.queryFilesystemInfoAsync.bind(extFile);
1922
+ extFile.enumerateChildren = _ExtFile.prototype.enumerateChildren.bind(extFile);
1923
+ extFile.enumerateChildrenAsync = _ExtFile.prototype.enumerateChildrenAsync.bind(extFile);
1924
+ extFile.loadContents = _ExtFile.prototype.loadContents.bind(extFile);
1925
+ extFile.loadContentsAsync = _ExtFile.prototype.loadContentsAsync.bind(extFile);
1950
1926
  return extFile;
1951
1927
  }
1952
1928
  /**
@@ -2201,7 +2177,7 @@ var ExtFile = class extends gio_2_0_default.File {
2201
2177
  let info = enumerator.next_file(null);
2202
2178
  while (info) {
2203
2179
  const child = enumerator.get_child(info);
2204
- list.push(ExtFile.extend(child));
2180
+ list.push(_ExtFile.extend(child));
2205
2181
  info = enumerator.next_file(null);
2206
2182
  }
2207
2183
  return list;
@@ -2232,7 +2208,7 @@ var ExtFile = class extends gio_2_0_default.File {
2232
2208
  let info = await extEnumerator.nextFileAsync();
2233
2209
  while (info) {
2234
2210
  const child = extEnumerator.get_child(info);
2235
- list.push(ExtFile.extend(child));
2211
+ list.push(_ExtFile.extend(child));
2236
2212
  info = await extEnumerator.nextFileAsync();
2237
2213
  }
2238
2214
  return resolve(list);
@@ -4080,7 +4056,7 @@ var {
4080
4056
  var {
4081
4057
  Error: Error3,
4082
4058
  RangeError,
4083
- ReferenceError,
4059
+ ReferenceError: ReferenceError2,
4084
4060
  SyntaxError,
4085
4061
  TypeError: TypeError2,
4086
4062
  URIError,
@@ -4111,7 +4087,7 @@ var {
4111
4087
  var errorMap = {};
4112
4088
  registerErrorClass("Error", Error3);
4113
4089
  registerErrorClass("RangeError", RangeError);
4114
- registerErrorClass("ReferenceError", ReferenceError);
4090
+ registerErrorClass("ReferenceError", ReferenceError2);
4115
4091
  registerErrorClass("SyntaxError", SyntaxError);
4116
4092
  registerErrorClass("TypeError", TypeError2);
4117
4093
  registerErrorClass("URIError", URIError);
@@ -5219,9 +5195,9 @@ var MIN_GROUP_LENGTH = 6;
5219
5195
  var STR_ABBREVIATE_SIZE = 100;
5220
5196
  var PROMISE_STRING_BASE_LENGTH = 12;
5221
5197
  var CSI = class {
5198
+ static kClear = "\x1B[1;1H";
5199
+ static kClearScreenDown = "\x1B[0J";
5222
5200
  };
5223
- __publicField(CSI, "kClear", "\x1B[1;1H");
5224
- __publicField(CSI, "kClearScreenDown", "\x1B[0J");
5225
5201
  function getClassInstanceName(instance) {
5226
5202
  if (typeof instance != "object") {
5227
5203
  return "";
@@ -6544,246 +6520,262 @@ function getConsoleInspectOptions() {
6544
6520
  colors: !getNoColor()
6545
6521
  };
6546
6522
  }
6547
- var _printFunc, _a;
6548
6523
  var Console = class {
6524
+ #printFunc = null;
6525
+ // @ts-ignore
6526
+ [isConsoleInstance] = false;
6527
+ indentLevel = 0;
6549
6528
  constructor(printFunc) {
6550
- __privateAdd(this, _printFunc, null);
6551
- // @ts-ignore
6552
- __publicField(this, _a, false);
6553
- __publicField(this, "indentLevel", 0);
6554
- __publicField(this, "log", (...args) => {
6555
- __privateGet(this, _printFunc).call(this, inspectArgs(args, {
6529
+ this.#printFunc = printFunc;
6530
+ this.indentLevel = 0;
6531
+ this[isConsoleInstance] = true;
6532
+ const console2 = ObjectCreate2({}, {
6533
+ [SymbolToStringTag2]: {
6534
+ enumerable: false,
6535
+ writable: false,
6536
+ configurable: true,
6537
+ value: "console"
6538
+ }
6539
+ });
6540
+ ObjectAssign4(console2, this);
6541
+ return console2;
6542
+ }
6543
+ log = (...args) => {
6544
+ this.#printFunc(
6545
+ inspectArgs(args, {
6556
6546
  ...getConsoleInspectOptions(),
6557
6547
  indentLevel: this.indentLevel
6558
- }) + "\n", 1);
6559
- });
6560
- __publicField(this, "debug", (...args) => {
6561
- __privateGet(this, _printFunc).call(this, inspectArgs(args, {
6548
+ }) + "\n",
6549
+ 1
6550
+ );
6551
+ };
6552
+ debug = (...args) => {
6553
+ this.#printFunc(
6554
+ inspectArgs(args, {
6562
6555
  ...getConsoleInspectOptions(),
6563
6556
  indentLevel: this.indentLevel
6564
- }) + "\n", 0);
6565
- });
6566
- __publicField(this, "info", (...args) => {
6567
- __privateGet(this, _printFunc).call(this, inspectArgs(args, {
6557
+ }) + "\n",
6558
+ 0
6559
+ );
6560
+ };
6561
+ info = (...args) => {
6562
+ this.#printFunc(
6563
+ inspectArgs(args, {
6568
6564
  ...getConsoleInspectOptions(),
6569
6565
  indentLevel: this.indentLevel
6570
- }) + "\n", 1);
6571
- });
6572
- __publicField(this, "dir", (obj = void 0, options = {}) => {
6573
- __privateGet(this, _printFunc).call(this, inspectArgs([obj], { ...getConsoleInspectOptions(), ...options }) + "\n", 1);
6574
- });
6575
- __publicField(this, "dirxml", this.dir);
6576
- __publicField(this, "warn", (...args) => {
6577
- __privateGet(this, _printFunc).call(this, inspectArgs(args, {
6566
+ }) + "\n",
6567
+ 1
6568
+ );
6569
+ };
6570
+ dir = (obj = void 0, options = {}) => {
6571
+ this.#printFunc(
6572
+ inspectArgs([obj], { ...getConsoleInspectOptions(), ...options }) + "\n",
6573
+ 1
6574
+ );
6575
+ };
6576
+ dirxml = this.dir;
6577
+ warn = (...args) => {
6578
+ this.#printFunc(
6579
+ inspectArgs(args, {
6578
6580
  ...getConsoleInspectOptions(),
6579
6581
  indentLevel: this.indentLevel
6580
- }) + "\n", 2);
6581
- });
6582
- __publicField(this, "error", (...args) => {
6583
- __privateGet(this, _printFunc).call(this, inspectArgs(args, {
6582
+ }) + "\n",
6583
+ 2
6584
+ );
6585
+ };
6586
+ error = (...args) => {
6587
+ this.#printFunc(
6588
+ inspectArgs(args, {
6584
6589
  ...getConsoleInspectOptions(),
6585
6590
  indentLevel: this.indentLevel
6586
- }) + "\n", 3);
6587
- });
6588
- __publicField(this, "assert", (condition = false, ...args) => {
6589
- if (condition) {
6590
- return;
6591
- }
6592
- if (args.length === 0) {
6593
- this.error("Assertion failed");
6594
- return;
6595
- }
6596
- const [first, ...rest] = new SafeArrayIterator(args);
6597
- if (typeof first === "string") {
6598
- this.error(
6599
- `Assertion failed: ${first}`,
6600
- ...new SafeArrayIterator(rest)
6601
- );
6602
- return;
6603
- }
6604
- this.error(`Assertion failed:`, ...new SafeArrayIterator(args));
6605
- });
6606
- __publicField(this, "count", (label = "default") => {
6607
- label = String3(label);
6608
- if (MapPrototypeHas2(countMap, label)) {
6609
- const current = MapPrototypeGet2(countMap, label) || 0;
6610
- MapPrototypeSet2(countMap, label, current + 1);
6611
- } else {
6612
- MapPrototypeSet2(countMap, label, 1);
6613
- }
6614
- this.info(`${label}: ${MapPrototypeGet2(countMap, label)}`);
6615
- });
6616
- __publicField(this, "countReset", (label = "default") => {
6617
- label = String3(label);
6618
- if (MapPrototypeHas2(countMap, label)) {
6619
- MapPrototypeSet2(countMap, label, 0);
6620
- } else {
6621
- this.warn(`Count for '${label}' does not exist`);
6622
- }
6591
+ }) + "\n",
6592
+ 3
6593
+ );
6594
+ };
6595
+ assert = (condition = false, ...args) => {
6596
+ if (condition) {
6597
+ return;
6598
+ }
6599
+ if (args.length === 0) {
6600
+ this.error("Assertion failed");
6601
+ return;
6602
+ }
6603
+ const [first, ...rest] = new SafeArrayIterator(args);
6604
+ if (typeof first === "string") {
6605
+ this.error(
6606
+ `Assertion failed: ${first}`,
6607
+ ...new SafeArrayIterator(rest)
6608
+ );
6609
+ return;
6610
+ }
6611
+ this.error(`Assertion failed:`, ...new SafeArrayIterator(args));
6612
+ };
6613
+ count = (label = "default") => {
6614
+ label = String3(label);
6615
+ if (MapPrototypeHas2(countMap, label)) {
6616
+ const current = MapPrototypeGet2(countMap, label) || 0;
6617
+ MapPrototypeSet2(countMap, label, current + 1);
6618
+ } else {
6619
+ MapPrototypeSet2(countMap, label, 1);
6620
+ }
6621
+ this.info(`${label}: ${MapPrototypeGet2(countMap, label)}`);
6622
+ };
6623
+ countReset = (label = "default") => {
6624
+ label = String3(label);
6625
+ if (MapPrototypeHas2(countMap, label)) {
6626
+ MapPrototypeSet2(countMap, label, 0);
6627
+ } else {
6628
+ this.warn(`Count for '${label}' does not exist`);
6629
+ }
6630
+ };
6631
+ table = (data = void 0, properties = void 0) => {
6632
+ if (properties !== void 0 && !ArrayIsArray(properties)) {
6633
+ throw new Error4(
6634
+ "The 'properties' argument must be of type Array. Received type string"
6635
+ );
6636
+ }
6637
+ if (data === null || typeof data !== "object") {
6638
+ return this.log(data);
6639
+ }
6640
+ const stringifyValue = (value) => inspectValueWithQuotes(value, {
6641
+ ...DEFAULT_INSPECT_OPTIONS,
6642
+ depth: 1
6623
6643
  });
6624
- __publicField(this, "table", (data = void 0, properties = void 0) => {
6625
- if (properties !== void 0 && !ArrayIsArray(properties)) {
6626
- throw new Error4(
6627
- "The 'properties' argument must be of type Array. Received type string"
6628
- );
6629
- }
6630
- if (data === null || typeof data !== "object") {
6631
- return this.log(data);
6632
- }
6633
- const stringifyValue = (value) => inspectValueWithQuotes(value, {
6634
- ...DEFAULT_INSPECT_OPTIONS,
6635
- depth: 1
6644
+ const toTable = (header2, body2) => this.log(cliTable(header2, body2));
6645
+ let resultData;
6646
+ const isSet = ObjectPrototypeIsPrototypeOf3(SetPrototype, data);
6647
+ const isMap = ObjectPrototypeIsPrototypeOf3(MapPrototype, data);
6648
+ const valuesKey = "Values";
6649
+ const indexKey = isSet || isMap ? "(iter idx)" : "(idx)";
6650
+ if (isSet) {
6651
+ resultData = [...new SafeSet2(data)];
6652
+ } else if (isMap) {
6653
+ let idx = 0;
6654
+ resultData = {};
6655
+ MapPrototypeForEach(data, (v, k) => {
6656
+ resultData[idx] = { Key: k, Values: v };
6657
+ idx++;
6636
6658
  });
6637
- const toTable = (header2, body2) => this.log(cliTable(header2, body2));
6638
- let resultData;
6639
- const isSet = ObjectPrototypeIsPrototypeOf3(SetPrototype, data);
6640
- const isMap = ObjectPrototypeIsPrototypeOf3(MapPrototype, data);
6641
- const valuesKey = "Values";
6642
- const indexKey = isSet || isMap ? "(iter idx)" : "(idx)";
6643
- if (isSet) {
6644
- resultData = [...new SafeSet2(data)];
6645
- } else if (isMap) {
6646
- let idx = 0;
6647
- resultData = {};
6648
- MapPrototypeForEach(data, (v, k) => {
6649
- resultData[idx] = { Key: k, Values: v };
6650
- idx++;
6651
- });
6659
+ } else {
6660
+ resultData = data;
6661
+ }
6662
+ const keys = ObjectKeys(resultData);
6663
+ const numRows = keys.length;
6664
+ const objectValues = properties ? ObjectFromEntries2(
6665
+ // @ts-ignore
6666
+ ArrayPrototypeMap4(
6667
+ properties,
6668
+ (name) => [name, ArrayPrototypeFill2(new Array3(numRows), "")]
6669
+ )
6670
+ ) : {};
6671
+ const indexKeys = [];
6672
+ const values = [];
6673
+ let hasPrimitives = false;
6674
+ keys.forEach((k, idx) => {
6675
+ const value = resultData[k];
6676
+ const primitive = value === null || typeof value !== "function" && typeof value !== "object";
6677
+ if (properties === void 0 && primitive) {
6678
+ hasPrimitives = true;
6679
+ ArrayPrototypePush4(values, stringifyValue(value));
6652
6680
  } else {
6653
- resultData = data;
6654
- }
6655
- const keys = ObjectKeys(resultData);
6656
- const numRows = keys.length;
6657
- const objectValues = properties ? ObjectFromEntries2(
6658
- // @ts-ignore
6659
- ArrayPrototypeMap4(
6660
- properties,
6661
- (name) => [name, ArrayPrototypeFill2(new Array3(numRows), "")]
6662
- )
6663
- ) : {};
6664
- const indexKeys = [];
6665
- const values = [];
6666
- let hasPrimitives = false;
6667
- keys.forEach((k, idx) => {
6668
- const value = resultData[k];
6669
- const primitive = value === null || typeof value !== "function" && typeof value !== "object";
6670
- if (properties === void 0 && primitive) {
6671
- hasPrimitives = true;
6672
- ArrayPrototypePush4(values, stringifyValue(value));
6673
- } else {
6674
- const valueObj = value || {};
6675
- const keys2 = properties || ObjectKeys(valueObj);
6676
- for (let i = 0; i < keys2.length; ++i) {
6677
- const k2 = keys2[i];
6678
- if (!primitive && ReflectHas2(valueObj, k2)) {
6679
- if (!ReflectHas2(objectValues, k2)) {
6680
- objectValues[k2] = ArrayPrototypeFill2(new Array3(numRows), "");
6681
- }
6682
- objectValues[k2][idx] = stringifyValue(valueObj[k2]);
6681
+ const valueObj = value || {};
6682
+ const keys2 = properties || ObjectKeys(valueObj);
6683
+ for (let i = 0; i < keys2.length; ++i) {
6684
+ const k2 = keys2[i];
6685
+ if (!primitive && ReflectHas2(valueObj, k2)) {
6686
+ if (!ReflectHas2(objectValues, k2)) {
6687
+ objectValues[k2] = ArrayPrototypeFill2(new Array3(numRows), "");
6683
6688
  }
6689
+ objectValues[k2][idx] = stringifyValue(valueObj[k2]);
6684
6690
  }
6685
- ArrayPrototypePush4(values, "");
6686
6691
  }
6687
- ArrayPrototypePush4(indexKeys, k);
6688
- });
6689
- const headerKeys = ObjectKeys(objectValues);
6690
- const bodyValues = ObjectValues(objectValues);
6691
- const headerProps = properties || [
6692
- ...new SafeArrayIterator(headerKeys),
6693
- !isMap && hasPrimitives && valuesKey
6694
- ];
6695
- const header = ArrayPrototypeFilter([
6696
- indexKey,
6697
- ...new SafeArrayIterator(headerProps)
6698
- ], Boolean);
6699
- const body = [indexKeys, ...new SafeArrayIterator(bodyValues), values];
6700
- toTable(header, body);
6701
- });
6702
- __publicField(this, "time", (label = "default") => {
6703
- label = String3(label);
6704
- if (MapPrototypeHas2(timerMap, label)) {
6705
- this.warn(`Timer '${label}' already exists`);
6706
- return;
6707
- }
6708
- MapPrototypeSet2(timerMap, label, DateNow());
6709
- });
6710
- __publicField(this, "timeLog", (label = "default", ...args) => {
6711
- label = String3(label);
6712
- if (!MapPrototypeHas2(timerMap, label)) {
6713
- this.warn(`Timer '${label}' does not exists`);
6714
- return;
6715
- }
6716
- const startTime = MapPrototypeGet2(timerMap, label);
6717
- const duration = DateNow() - startTime;
6718
- this.info(`${label}: ${duration}ms`, ...new SafeArrayIterator(args));
6719
- });
6720
- __publicField(this, "timeEnd", (label = "default") => {
6721
- label = String3(label);
6722
- if (!MapPrototypeHas2(timerMap, label)) {
6723
- this.warn(`Timer '${label}' does not exist`);
6724
- return;
6725
- }
6726
- const startTime = MapPrototypeGet2(timerMap, label);
6727
- MapPrototypeDelete2(timerMap, label);
6728
- const duration = DateNow() - startTime;
6729
- this.info(`${label}: ${duration}ms`);
6730
- });
6731
- __publicField(this, "group", (...label) => {
6732
- if (label.length > 0) {
6733
- this.log(...new SafeArrayIterator(label));
6734
- }
6735
- this.indentLevel += 2;
6736
- });
6737
- __publicField(this, "groupCollapsed", this.group);
6738
- __publicField(this, "groupEnd", () => {
6739
- if (this.indentLevel > 0) {
6740
- this.indentLevel -= 2;
6692
+ ArrayPrototypePush4(values, "");
6741
6693
  }
6694
+ ArrayPrototypePush4(indexKeys, k);
6742
6695
  });
6743
- __publicField(this, "clear", () => {
6744
- this.indentLevel = 0;
6745
- __privateGet(this, _printFunc).call(this, CSI.kClear, 1);
6746
- __privateGet(this, _printFunc).call(this, CSI.kClearScreenDown, 1);
6747
- });
6748
- __publicField(this, "trace", (...args) => {
6749
- const message = inspectArgs(
6750
- args,
6751
- { ...getConsoleInspectOptions(), indentLevel: 0 }
6752
- );
6753
- const err = {
6754
- name: "Trace",
6755
- message
6756
- };
6757
- ErrorCaptureStackTrace2(err, this.trace);
6758
- this.error(err.stack);
6759
- });
6760
- // These methods are noops, but when the inspector is connected, they
6761
- // call into V8.
6762
- __publicField(this, "profile", (_label) => {
6763
- });
6764
- __publicField(this, "profileEnd", (_label) => {
6765
- });
6766
- __publicField(this, "timeStamp", (_label) => {
6767
- });
6768
- __privateSet(this, _printFunc, printFunc);
6696
+ const headerKeys = ObjectKeys(objectValues);
6697
+ const bodyValues = ObjectValues(objectValues);
6698
+ const headerProps = properties || [
6699
+ ...new SafeArrayIterator(headerKeys),
6700
+ !isMap && hasPrimitives && valuesKey
6701
+ ];
6702
+ const header = ArrayPrototypeFilter([
6703
+ indexKey,
6704
+ ...new SafeArrayIterator(headerProps)
6705
+ ], Boolean);
6706
+ const body = [indexKeys, ...new SafeArrayIterator(bodyValues), values];
6707
+ toTable(header, body);
6708
+ };
6709
+ time = (label = "default") => {
6710
+ label = String3(label);
6711
+ if (MapPrototypeHas2(timerMap, label)) {
6712
+ this.warn(`Timer '${label}' already exists`);
6713
+ return;
6714
+ }
6715
+ MapPrototypeSet2(timerMap, label, DateNow());
6716
+ };
6717
+ timeLog = (label = "default", ...args) => {
6718
+ label = String3(label);
6719
+ if (!MapPrototypeHas2(timerMap, label)) {
6720
+ this.warn(`Timer '${label}' does not exists`);
6721
+ return;
6722
+ }
6723
+ const startTime = MapPrototypeGet2(timerMap, label);
6724
+ const duration = DateNow() - startTime;
6725
+ this.info(`${label}: ${duration}ms`, ...new SafeArrayIterator(args));
6726
+ };
6727
+ timeEnd = (label = "default") => {
6728
+ label = String3(label);
6729
+ if (!MapPrototypeHas2(timerMap, label)) {
6730
+ this.warn(`Timer '${label}' does not exist`);
6731
+ return;
6732
+ }
6733
+ const startTime = MapPrototypeGet2(timerMap, label);
6734
+ MapPrototypeDelete2(timerMap, label);
6735
+ const duration = DateNow() - startTime;
6736
+ this.info(`${label}: ${duration}ms`);
6737
+ };
6738
+ group = (...label) => {
6739
+ if (label.length > 0) {
6740
+ this.log(...new SafeArrayIterator(label));
6741
+ }
6742
+ this.indentLevel += 2;
6743
+ };
6744
+ groupCollapsed = this.group;
6745
+ groupEnd = () => {
6746
+ if (this.indentLevel > 0) {
6747
+ this.indentLevel -= 2;
6748
+ }
6749
+ };
6750
+ clear = () => {
6769
6751
  this.indentLevel = 0;
6770
- this[isConsoleInstance] = true;
6771
- const console2 = ObjectCreate2({}, {
6772
- [SymbolToStringTag2]: {
6773
- enumerable: false,
6774
- writable: false,
6775
- configurable: true,
6776
- value: "console"
6777
- }
6778
- });
6779
- ObjectAssign4(console2, this);
6780
- return console2;
6781
- }
6782
- static [(_a = isConsoleInstance, SymbolHasInstance)](instance) {
6752
+ this.#printFunc(CSI.kClear, 1);
6753
+ this.#printFunc(CSI.kClearScreenDown, 1);
6754
+ };
6755
+ trace = (...args) => {
6756
+ const message = inspectArgs(
6757
+ args,
6758
+ { ...getConsoleInspectOptions(), indentLevel: 0 }
6759
+ );
6760
+ const err = {
6761
+ name: "Trace",
6762
+ message
6763
+ };
6764
+ ErrorCaptureStackTrace2(err, this.trace);
6765
+ this.error(err.stack);
6766
+ };
6767
+ // These methods are noops, but when the inspector is connected, they
6768
+ // call into V8.
6769
+ profile = (_label) => {
6770
+ };
6771
+ profileEnd = (_label) => {
6772
+ };
6773
+ timeStamp = (_label) => {
6774
+ };
6775
+ static [SymbolHasInstance](instance) {
6783
6776
  return instance[isConsoleInstance];
6784
6777
  }
6785
6778
  };
6786
- _printFunc = new WeakMap();
6787
6779
  var customInspect = SymbolFor2("Deno.customInspect");
6788
6780
  function inspect(value, inspectOptions = {}) {
6789
6781
  circular = void 0;
@@ -7095,7 +7087,7 @@ var _dispatched = Symbol5("[[dispatched]]");
7095
7087
  var _isTrusted = Symbol5("[[isTrusted]]");
7096
7088
  var _path = Symbol5("[[path]]");
7097
7089
  var _skipInternalInit = Symbol5("[[skipSlowInit]]");
7098
- var Event = class {
7090
+ var Event = class _Event {
7099
7091
  /** Returns true if event was dispatched by the user agent, and false
7100
7092
  * otherwise. */
7101
7093
  isTrusted;
@@ -7124,7 +7116,7 @@ var Event = class {
7124
7116
  type: type2,
7125
7117
  ...eventInit,
7126
7118
  currentTarget: null,
7127
- eventPhase: Event.NONE,
7119
+ eventPhase: _Event.NONE,
7128
7120
  target: null,
7129
7121
  timeStamp: DateNow2()
7130
7122
  };
@@ -7140,7 +7132,7 @@ var Event = class {
7140
7132
  cancelable: eventInitDict.cancelable ?? false,
7141
7133
  composed: eventInitDict.composed ?? false,
7142
7134
  currentTarget: null,
7143
- eventPhase: Event.NONE,
7135
+ eventPhase: _Event.NONE,
7144
7136
  target: null,
7145
7137
  timeStamp: DateNow2()
7146
7138
  };
@@ -7150,7 +7142,7 @@ var Event = class {
7150
7142
  [SymbolFor4("Deno.privateCustomInspect")](inspect2) {
7151
7143
  return inspect2(createFilteredInspectProxy({
7152
7144
  object: this,
7153
- evaluate: ObjectPrototypeIsPrototypeOf5(Event.prototype, this),
7145
+ evaluate: ObjectPrototypeIsPrototypeOf5(_Event.prototype, this),
7154
7146
  // @ts-ignore
7155
7147
  keys: EVENT_PROPS
7156
7148
  }));
@@ -7270,16 +7262,16 @@ var Event = class {
7270
7262
  return ArrayPrototypeMap5(composedPath, (p) => p.item);
7271
7263
  }
7272
7264
  get NONE() {
7273
- return Event.NONE;
7265
+ return _Event.NONE;
7274
7266
  }
7275
7267
  get CAPTURING_PHASE() {
7276
- return Event.CAPTURING_PHASE;
7268
+ return _Event.CAPTURING_PHASE;
7277
7269
  }
7278
7270
  get AT_TARGET() {
7279
- return Event.AT_TARGET;
7271
+ return _Event.AT_TARGET;
7280
7272
  }
7281
7273
  get BUBBLING_PHASE() {
7282
- return Event.BUBBLING_PHASE;
7274
+ return _Event.BUBBLING_PHASE;
7283
7275
  }
7284
7276
  static get NONE() {
7285
7277
  return 0;
@@ -7817,7 +7809,7 @@ defineEnumerableProps(EventTarget2, [
7817
7809
  "removeEventListener",
7818
7810
  "dispatchEvent"
7819
7811
  ]);
7820
- var ErrorEvent = class extends Event {
7812
+ var ErrorEvent = class _ErrorEvent extends Event {
7821
7813
  #message = "";
7822
7814
  #filename = "";
7823
7815
  #lineno = 0;
@@ -7862,7 +7854,7 @@ var ErrorEvent = class extends Event {
7862
7854
  [SymbolFor4("Deno.privateCustomInspect")](inspect2) {
7863
7855
  return inspect2(createFilteredInspectProxy({
7864
7856
  object: this,
7865
- evaluate: ObjectPrototypeIsPrototypeOf5(ErrorEvent.prototype, this),
7857
+ evaluate: ObjectPrototypeIsPrototypeOf5(_ErrorEvent.prototype, this),
7866
7858
  keys: [
7867
7859
  ...new SafeArrayIterator2(EVENT_PROPS),
7868
7860
  "message",
@@ -7884,7 +7876,7 @@ defineEnumerableProps(ErrorEvent, [
7884
7876
  "colno",
7885
7877
  "error"
7886
7878
  ]);
7887
- var CloseEvent = class extends Event {
7879
+ var CloseEvent = class _CloseEvent extends Event {
7888
7880
  #wasClean = false;
7889
7881
  #code = 0;
7890
7882
  #reason = "";
@@ -7917,7 +7909,7 @@ var CloseEvent = class extends Event {
7917
7909
  [SymbolFor4("Deno.privateCustomInspect")](inspect2) {
7918
7910
  return inspect2(createFilteredInspectProxy({
7919
7911
  object: this,
7920
- evaluate: ObjectPrototypeIsPrototypeOf5(CloseEvent.prototype, this),
7912
+ evaluate: ObjectPrototypeIsPrototypeOf5(_CloseEvent.prototype, this),
7921
7913
  keys: [
7922
7914
  ...new SafeArrayIterator2(EVENT_PROPS),
7923
7915
  "wasClean",
@@ -7927,7 +7919,7 @@ var CloseEvent = class extends Event {
7927
7919
  }));
7928
7920
  }
7929
7921
  };
7930
- var MessageEvent = class extends Event {
7922
+ var MessageEvent = class _MessageEvent extends Event {
7931
7923
  /**
7932
7924
  * Returns the data of the message.
7933
7925
  */
@@ -7959,7 +7951,7 @@ var MessageEvent = class extends Event {
7959
7951
  [SymbolFor4("Deno.privateCustomInspect")](inspect2) {
7960
7952
  return inspect2(createFilteredInspectProxy({
7961
7953
  object: this,
7962
- evaluate: ObjectPrototypeIsPrototypeOf5(MessageEvent.prototype, this),
7954
+ evaluate: ObjectPrototypeIsPrototypeOf5(_MessageEvent.prototype, this),
7963
7955
  keys: [
7964
7956
  ...new SafeArrayIterator2(EVENT_PROPS),
7965
7957
  "data",
@@ -7972,7 +7964,7 @@ var MessageEvent = class extends Event {
7972
7964
  // @ts-ignore
7973
7965
  [SymbolToStringTag3] = "CloseEvent";
7974
7966
  };
7975
- var CustomEvent = class extends Event {
7967
+ var CustomEvent = class _CustomEvent extends Event {
7976
7968
  #detail = null;
7977
7969
  constructor(type2, eventInitDict = {}) {
7978
7970
  super(type2, eventInitDict);
@@ -7988,7 +7980,7 @@ var CustomEvent = class extends Event {
7988
7980
  [SymbolFor4("Deno.privateCustomInspect")](inspect2) {
7989
7981
  return inspect2(createFilteredInspectProxy({
7990
7982
  object: this,
7991
- evaluate: ObjectPrototypeIsPrototypeOf5(CustomEvent.prototype, this),
7983
+ evaluate: ObjectPrototypeIsPrototypeOf5(_CustomEvent.prototype, this),
7992
7984
  keys: [
7993
7985
  ...new SafeArrayIterator2(EVENT_PROPS),
7994
7986
  "detail"
@@ -8002,7 +7994,7 @@ var CustomEvent = class extends Event {
8002
7994
  ReflectDefineProperty3(CustomEvent.prototype, "detail", {
8003
7995
  enumerable: true
8004
7996
  });
8005
- var ProgressEvent = class extends Event {
7997
+ var ProgressEvent = class _ProgressEvent extends Event {
8006
7998
  lengthComputable;
8007
7999
  loaded;
8008
8000
  // readonly target: EventTarget | null;
@@ -8016,7 +8008,7 @@ var ProgressEvent = class extends Event {
8016
8008
  [SymbolFor4("Deno.privateCustomInspect")](inspect2) {
8017
8009
  return inspect2(createFilteredInspectProxy({
8018
8010
  object: this,
8019
- evaluate: ObjectPrototypeIsPrototypeOf5(ProgressEvent.prototype, this),
8011
+ evaluate: ObjectPrototypeIsPrototypeOf5(_ProgressEvent.prototype, this),
8020
8012
  keys: [
8021
8013
  ...new SafeArrayIterator2(EVENT_PROPS),
8022
8014
  "lengthComputable",
@@ -8029,7 +8021,7 @@ var ProgressEvent = class extends Event {
8029
8021
  // @ts-ignore
8030
8022
  [SymbolToStringTag3] = "ProgressEvent";
8031
8023
  };
8032
- var PromiseRejectionEvent = class extends Event {
8024
+ var PromiseRejectionEvent = class _PromiseRejectionEvent extends Event {
8033
8025
  #promise = null;
8034
8026
  #reason = null;
8035
8027
  get promise() {
@@ -8057,7 +8049,7 @@ var PromiseRejectionEvent = class extends Event {
8057
8049
  return inspect2(createFilteredInspectProxy({
8058
8050
  object: this,
8059
8051
  evaluate: ObjectPrototypeIsPrototypeOf5(
8060
- PromiseRejectionEvent.prototype,
8052
+ _PromiseRejectionEvent.prototype,
8061
8053
  this
8062
8054
  ),
8063
8055
  keys: [
@@ -8488,12 +8480,12 @@ var abortAlgos = Symbol6("[[abortAlgos]]");
8488
8480
  var signal = Symbol6("[[signal]]");
8489
8481
  var timerId = Symbol6("[[timerId]]");
8490
8482
  var illegalConstructorKey = Symbol6("illegalConstructorKey");
8491
- var AbortSignal = class extends EventTarget2 {
8483
+ var AbortSignal = class _AbortSignal extends EventTarget2 {
8492
8484
  static abort(reason = void 0) {
8493
8485
  if (reason !== void 0) {
8494
8486
  reason = converters.any(reason);
8495
8487
  }
8496
- const signal2 = new AbortSignal(illegalConstructorKey);
8488
+ const signal2 = new _AbortSignal(illegalConstructorKey);
8497
8489
  signal2[signalAbort](reason);
8498
8490
  return signal2;
8499
8491
  }
@@ -8503,7 +8495,7 @@ var AbortSignal = class extends EventTarget2 {
8503
8495
  millis = converters["unsigned long long"](millis, {
8504
8496
  enforceRange: true
8505
8497
  });
8506
- const signal2 = new AbortSignal(illegalConstructorKey);
8498
+ const signal2 = new _AbortSignal(illegalConstructorKey);
8507
8499
  signal2[timerId] = setTimeout2(
8508
8500
  () => {
8509
8501
  signal2[timerId] = null;