@peerbit/indexer-sqlite3 1.2.28 → 1.2.30

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/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2022 dao.xyz
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  mod
31
31
  ));
32
32
 
33
- // ../../../../node_modules/@protobufjs/float/index.js
33
+ // ../../../../node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js
34
34
  var require_float = __commonJS({
35
- "../../../../node_modules/@protobufjs/float/index.js"(exports, module) {
35
+ "../../../../node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js"(exports, module) {
36
36
  "use strict";
37
37
  module.exports = factory(factory);
38
38
  function factory(exports2) {
@@ -224,9 +224,9 @@ var require_float = __commonJS({
224
224
  }
225
225
  });
226
226
 
227
- // ../../../../node_modules/@protobufjs/utf8/index.js
227
+ // ../../../../node_modules/.pnpm/@protobufjs+utf8@1.1.0/node_modules/@protobufjs/utf8/index.js
228
228
  var require_utf8 = __commonJS({
229
- "../../../../node_modules/@protobufjs/utf8/index.js"(exports) {
229
+ "../../../../node_modules/.pnpm/@protobufjs+utf8@1.1.0/node_modules/@protobufjs/utf8/index.js"(exports) {
230
230
  "use strict";
231
231
  var utf82 = exports;
232
232
  utf82.length = function utf8_length(string) {
@@ -307,15 +307,15 @@ var require_fs = __commonJS({
307
307
  }
308
308
  });
309
309
 
310
- // (disabled):../../../../node_modules/path/path.js
310
+ // (disabled):../../../../node_modules/.pnpm/path@0.12.7/node_modules/path/path.js
311
311
  var require_path = __commonJS({
312
- "(disabled):../../../../node_modules/path/path.js"() {
312
+ "(disabled):../../../../node_modules/.pnpm/path@0.12.7/node_modules/path/path.js"() {
313
313
  }
314
314
  });
315
315
 
316
- // ../../../../node_modules/libsodium/dist/modules/libsodium.js
316
+ // ../../../../node_modules/.pnpm/libsodium@0.7.15/node_modules/libsodium/dist/modules/libsodium.js
317
317
  var require_libsodium = __commonJS({
318
- "../../../../node_modules/libsodium/dist/modules/libsodium.js"(exports, module) {
318
+ "../../../../node_modules/.pnpm/libsodium@0.7.15/node_modules/libsodium/dist/modules/libsodium.js"(exports, module) {
319
319
  !function(A) {
320
320
  function I(A2) {
321
321
  "use strict";
@@ -2919,9 +2919,9 @@ var require_libsodium = __commonJS({
2919
2919
  }
2920
2920
  });
2921
2921
 
2922
- // ../../../../node_modules/libsodium-wrappers/dist/modules/libsodium-wrappers.js
2922
+ // ../../../../node_modules/.pnpm/libsodium-wrappers@0.7.15/node_modules/libsodium-wrappers/dist/modules/libsodium-wrappers.js
2923
2923
  var require_libsodium_wrappers = __commonJS({
2924
- "../../../../node_modules/libsodium-wrappers/dist/modules/libsodium-wrappers.js"(exports) {
2924
+ "../../../../node_modules/.pnpm/libsodium-wrappers@0.7.15/node_modules/libsodium-wrappers/dist/modules/libsodium-wrappers.js"(exports) {
2925
2925
  !function(e) {
2926
2926
  function a(e2, a2) {
2927
2927
  "use strict";
@@ -5522,11 +5522,11 @@ var require_libsodium_wrappers = __commonJS({
5522
5522
  }
5523
5523
  });
5524
5524
 
5525
- // ../../../../node_modules/@dao-xyz/borsh/lib/esm/binary.js
5525
+ // ../../../../node_modules/.pnpm/@dao-xyz+borsh@5.2.4/node_modules/@dao-xyz/borsh/lib/esm/binary.js
5526
5526
  var import_float = __toESM(require_float(), 1);
5527
5527
  var import_utf8 = __toESM(require_utf8(), 1);
5528
5528
 
5529
- // ../../../../node_modules/@dao-xyz/borsh/lib/esm/bigint.js
5529
+ // ../../../../node_modules/.pnpm/@dao-xyz+borsh@5.2.4/node_modules/@dao-xyz/borsh/lib/esm/bigint.js
5530
5530
  function arrayToHex(arr, reverse = false) {
5531
5531
  return [...reverse ? new Uint8Array(arr).reverse() : new Uint8Array(arr)].map((b) => b.toString(16).padStart(2, "0")).join("");
5532
5532
  }
@@ -5639,7 +5639,7 @@ var checkInt = (value, min, max, byteLength) => {
5639
5639
  }
5640
5640
  };
5641
5641
 
5642
- // ../../../../node_modules/@dao-xyz/borsh/lib/esm/error.js
5642
+ // ../../../../node_modules/.pnpm/@dao-xyz+borsh@5.2.4/node_modules/@dao-xyz/borsh/lib/esm/error.js
5643
5643
  var BorshError = class extends Error {
5644
5644
  constructor(message) {
5645
5645
  super(message);
@@ -5652,7 +5652,7 @@ var BorshError = class extends Error {
5652
5652
  }
5653
5653
  };
5654
5654
 
5655
- // ../../../../node_modules/@dao-xyz/borsh/lib/esm/binary.js
5655
+ // ../../../../node_modules/.pnpm/@dao-xyz+borsh@5.2.4/node_modules/@dao-xyz/borsh/lib/esm/binary.js
5656
5656
  var allocUnsafeFn = () => {
5657
5657
  if (globalThis.Buffer) {
5658
5658
  return globalThis.Buffer.allocUnsafe;
@@ -6074,7 +6074,7 @@ var BinaryReader = class _BinaryReader {
6074
6074
  }
6075
6075
  };
6076
6076
 
6077
- // ../../../../node_modules/@dao-xyz/borsh/lib/esm/types.js
6077
+ // ../../../../node_modules/.pnpm/@dao-xyz+borsh@5.2.4/node_modules/@dao-xyz/borsh/lib/esm/types.js
6078
6078
  var extendingClasses = (clazz) => {
6079
6079
  let ret = [];
6080
6080
  if (clazz instanceof Function) {
@@ -6153,7 +6153,7 @@ var StructKind = class {
6153
6153
  }
6154
6154
  };
6155
6155
 
6156
- // ../../../../node_modules/@dao-xyz/borsh/lib/esm/index.js
6156
+ // ../../../../node_modules/.pnpm/@dao-xyz+borsh@5.2.4/node_modules/@dao-xyz/borsh/lib/esm/index.js
6157
6157
  var MAX_PROTOTYPE_SEARCH = 250;
6158
6158
  var PROTOTYPE_POLLUTION_CONTEXT_RANGE = 500;
6159
6159
  var PROTOTYPE_DESERIALIZATION_HANDLER_OFFSET = 500;
@@ -6669,7 +6669,7 @@ var resize = (arr, newSize, defaultValue) => {
6669
6669
  arr.length = newSize;
6670
6670
  };
6671
6671
 
6672
- // ../../../../node_modules/multiformats/dist/src/bytes.js
6672
+ // ../../../../node_modules/.pnpm/multiformats@13.4.1/node_modules/multiformats/dist/src/bytes.js
6673
6673
  var empty = new Uint8Array(0);
6674
6674
  function coerce(o) {
6675
6675
  if (o instanceof Uint8Array && o.constructor.name === "Uint8Array") {
@@ -6684,7 +6684,7 @@ function coerce(o) {
6684
6684
  throw new Error("Unknown type, must be binary type");
6685
6685
  }
6686
6686
 
6687
- // ../../../../node_modules/multiformats/dist/src/vendor/base-x.js
6687
+ // ../../../../node_modules/.pnpm/multiformats@13.4.1/node_modules/multiformats/dist/src/vendor/base-x.js
6688
6688
  function base(ALPHABET, name) {
6689
6689
  if (ALPHABET.length >= 255) {
6690
6690
  throw new TypeError("Alphabet too long");
@@ -6820,7 +6820,7 @@ var src = base;
6820
6820
  var _brrp__multiformats_scope_baseX = src;
6821
6821
  var base_x_default = _brrp__multiformats_scope_baseX;
6822
6822
 
6823
- // ../../../../node_modules/multiformats/dist/src/bases/base.js
6823
+ // ../../../../node_modules/.pnpm/multiformats@13.4.1/node_modules/multiformats/dist/src/bases/base.js
6824
6824
  var Encoder = class {
6825
6825
  name;
6826
6826
  prefix;
@@ -6926,7 +6926,7 @@ function baseX({ name, prefix, alphabet }) {
6926
6926
  });
6927
6927
  }
6928
6928
 
6929
- // ../../../../node_modules/multiformats/dist/src/bases/base58.js
6929
+ // ../../../../node_modules/.pnpm/multiformats@13.4.1/node_modules/multiformats/dist/src/bases/base58.js
6930
6930
  var base58btc = baseX({
6931
6931
  name: "base58btc",
6932
6932
  prefix: "z",
@@ -6938,12 +6938,12 @@ var base58flickr = baseX({
6938
6938
  alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"
6939
6939
  });
6940
6940
 
6941
- // ../../../../node_modules/@stablelib/int/lib/int.js
6941
+ // ../../../../node_modules/.pnpm/@stablelib+int@2.0.1/node_modules/@stablelib/int/lib/int.js
6942
6942
  var isInteger = Number.isInteger;
6943
6943
  var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER;
6944
6944
  var isSafeInteger = Number.isSafeInteger;
6945
6945
 
6946
- // ../../../../node_modules/@stablelib/binary/lib/binary.js
6946
+ // ../../../../node_modules/.pnpm/@stablelib+binary@2.0.1/node_modules/@stablelib/binary/lib/binary.js
6947
6947
  function readUint32BE(array, offset = 0) {
6948
6948
  return (array[offset] << 24 | array[offset + 1] << 16 | array[offset + 2] << 8 | array[offset + 3]) >>> 0;
6949
6949
  }
@@ -6955,7 +6955,7 @@ function writeUint32BE(value, out = new Uint8Array(4), offset = 0) {
6955
6955
  return out;
6956
6956
  }
6957
6957
 
6958
- // ../../../../node_modules/@stablelib/wipe/lib/wipe.js
6958
+ // ../../../../node_modules/.pnpm/@stablelib+wipe@2.0.1/node_modules/@stablelib/wipe/lib/wipe.js
6959
6959
  function wipe(array) {
6960
6960
  for (let i = 0; i < array.length; i++) {
6961
6961
  array[i] = 0;
@@ -6963,7 +6963,7 @@ function wipe(array) {
6963
6963
  return array;
6964
6964
  }
6965
6965
 
6966
- // ../../../../node_modules/@stablelib/sha256/lib/sha256.js
6966
+ // ../../../../node_modules/.pnpm/@stablelib+sha256@2.0.1/node_modules/@stablelib/sha256/lib/sha256.js
6967
6967
  var DIGEST_LENGTH = 32;
6968
6968
  var BLOCK_SIZE = 64;
6969
6969
  var SHA256 = class {
@@ -7253,7 +7253,7 @@ var toBase58 = (arr) => {
7253
7253
  var sha256Base64Sync = (bytes) => toBase64(new SHA256().update(bytes).digest());
7254
7254
  var sha256Sync = (bytes) => new SHA256().update(bytes).digest();
7255
7255
 
7256
- // ../../../../node_modules/uint8-varint/dist/src/index.js
7256
+ // ../../../../node_modules/.pnpm/uint8-varint@2.0.4/node_modules/uint8-varint/dist/src/index.js
7257
7257
  var N1 = Math.pow(2, 7);
7258
7258
  var N2 = Math.pow(2, 14);
7259
7259
  var N3 = Math.pow(2, 21);
@@ -7562,7 +7562,7 @@ var toId = (obj) => {
7562
7562
  throw new Error("Unexpected index key: " + typeof obj + ", expected: string, number, bigint or Uint8Array");
7563
7563
  };
7564
7564
 
7565
- // ../../../../node_modules/uuid/dist/esm-browser/stringify.js
7565
+ // ../../../../node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-browser/stringify.js
7566
7566
  var byteToHex = [];
7567
7567
  for (i = 0; i < 256; ++i) {
7568
7568
  byteToHex.push((i + 256).toString(16).slice(1));
@@ -7572,7 +7572,7 @@ function unsafeStringify(arr, offset = 0) {
7572
7572
  return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
7573
7573
  }
7574
7574
 
7575
- // ../../../../node_modules/uuid/dist/esm-browser/rng.js
7575
+ // ../../../../node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-browser/rng.js
7576
7576
  var getRandomValues;
7577
7577
  var rnds8 = new Uint8Array(16);
7578
7578
  function rng() {
@@ -7585,13 +7585,13 @@ function rng() {
7585
7585
  return getRandomValues(rnds8);
7586
7586
  }
7587
7587
 
7588
- // ../../../../node_modules/uuid/dist/esm-browser/native.js
7588
+ // ../../../../node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-browser/native.js
7589
7589
  var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
7590
7590
  var native_default = {
7591
7591
  randomUUID
7592
7592
  };
7593
7593
 
7594
- // ../../../../node_modules/uuid/dist/esm-browser/v4.js
7594
+ // ../../../../node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-browser/v4.js
7595
7595
  function v4(options, buf, offset) {
7596
7596
  if (native_default.randomUUID && !buf && !options) {
7597
7597
  return native_default.randomUUID();
@@ -7989,7 +7989,7 @@ hrtime.bigint = (time) => {
7989
7989
  return BigInt(diff[0] * NS_PER_SEC + diff[1]);
7990
7990
  };
7991
7991
 
7992
- // ../../../../node_modules/p-defer/index.js
7992
+ // ../../../../node_modules/.pnpm/p-defer@4.0.1/node_modules/p-defer/index.js
7993
7993
  function pDefer() {
7994
7994
  const deferred = {};
7995
7995
  deferred.promise = new Promise((resolve, reject) => {
@@ -9681,11 +9681,18 @@ var SQLLiteIndex = class {
9681
9681
  await this.planner.stop();
9682
9682
  }
9683
9683
  async drop() {
9684
- if (this.closed) {
9685
- throw new Error(`Already closed index ${this.id}, can not drop`);
9684
+ if (!this.closed) {
9685
+ this.closed = true;
9686
+ }
9687
+ if (this.cursorPruner != null) {
9688
+ clearInterval(this.cursorPruner);
9689
+ this.cursorPruner = void 0;
9690
+ }
9691
+ const status = await this.properties.db.status?.();
9692
+ if (status === "closed") {
9693
+ this._tables.clear();
9694
+ return;
9686
9695
  }
9687
- this.closed = true;
9688
- clearInterval(this.cursorPruner);
9689
9696
  await this.clearStatements();
9690
9697
  for (const table of this._rootTables) {
9691
9698
  await this.properties.db.exec(`drop table if exists ${table.name}`);
@@ -9984,7 +9991,8 @@ var SQLiteIndices = class _SQLiteIndices {
9984
9991
  const scope2 = new _SQLiteIndices({
9985
9992
  scope: [...this._scope, name],
9986
9993
  db: this.properties.db,
9987
- parent: this
9994
+ parent: this,
9995
+ directory: this.properties.directory
9988
9996
  });
9989
9997
  if (!this.closed) {
9990
9998
  await scope2.start();
@@ -10048,7 +10056,7 @@ var encodeValue = (value) => {
10048
10056
  return { type: "simple", value };
10049
10057
  };
10050
10058
 
10051
- // ../../../../node_modules/@sqlite.org/sqlite-wasm/sqlite-wasm/jswasm/sqlite3-bundler-friendly.mjs
10059
+ // ../../../../node_modules/.pnpm/@sqlite.org+sqlite-wasm@3.50.4-build1/node_modules/@sqlite.org/sqlite-wasm/sqlite-wasm/jswasm/sqlite3-bundler-friendly.mjs
10052
10060
  var sqlite3InitModule = (() => {
10053
10061
  var _scriptName = import.meta.url;
10054
10062
  return function(moduleArg = {}) {
@@ -21344,7 +21352,7 @@ var toExportForESM = function() {
21344
21352
  sqlite3InitModule = toExportForESM;
21345
21353
  var sqlite3_bundler_friendly_default = sqlite3InitModule;
21346
21354
 
21347
- // ../../../../node_modules/@sqlite.org/sqlite-wasm/sqlite-wasm/jswasm/sqlite3-worker1-promiser.mjs
21355
+ // ../../../../node_modules/.pnpm/@sqlite.org+sqlite-wasm@3.50.4-build1/node_modules/@sqlite.org/sqlite-wasm/sqlite-wasm/jswasm/sqlite3-worker1-promiser.mjs
21348
21356
  globalThis.sqlite3Worker1Promiser = function callee(config = callee.defaultConfig) {
21349
21357
  if (1 === arguments.length && "function" === typeof arguments[0]) {
21350
21358
  const f = config;
@@ -21499,7 +21507,7 @@ sqlite3Worker1Promiser.v2 = function(config) {
21499
21507
  });
21500
21508
  var sqlite3_worker1_promiser_default = sqlite3Worker1Promiser.v2;
21501
21509
 
21502
- // ../../../../node_modules/@sqlite.org/sqlite-wasm/index.mjs
21510
+ // ../../../../node_modules/.pnpm/@sqlite.org+sqlite-wasm@3.50.4-build1/node_modules/@sqlite.org/sqlite-wasm/index.mjs
21503
21511
  var sqlite3Worker1Promiser2 = globalThis.sqlite3Worker1Promiser;
21504
21512
  var sqlite_wasm_default = sqlite3_bundler_friendly_default;
21505
21513
 
@@ -21577,18 +21585,76 @@ var create = async (directory) => {
21577
21585
  let statements = /* @__PURE__ */ new Map();
21578
21586
  sqlite3 = sqlite3 || await sqlite_wasm_default({ print: log, printErr: error });
21579
21587
  let sqliteDb = void 0;
21580
- let close = async () => {
21588
+ let closeInternal = async () => {
21581
21589
  await Promise.all([...statements.values()].map((x) => x.finalize?.()));
21582
21590
  statements.clear();
21583
21591
  await sqliteDb?.close();
21584
21592
  sqliteDb = void 0;
21585
21593
  };
21586
21594
  let dbFileName;
21587
- let drop = async () => {
21588
- if (poolUtil && dbFileName != null) {
21589
- poolUtil.unlink(dbFileName);
21595
+ const cleanupPool = async (_label, preserveDbFile) => {
21596
+ if (!poolUtil || dbFileName == null) {
21597
+ return;
21598
+ }
21599
+ const relatedFiles = /* @__PURE__ */ new Set([
21600
+ dbFileName,
21601
+ `${dbFileName}-journal`,
21602
+ `${dbFileName}-wal`,
21603
+ `${dbFileName}-shm`
21604
+ ]);
21605
+ for (const fileName of relatedFiles) {
21606
+ if (preserveDbFile && fileName === dbFileName) {
21607
+ continue;
21608
+ }
21609
+ try {
21610
+ poolUtil.unlink(fileName);
21611
+ } catch {
21612
+ }
21613
+ }
21614
+ const wipePool = async () => {
21615
+ if (preserveDbFile || !poolUtil?.wipeFiles) {
21616
+ return;
21617
+ }
21618
+ try {
21619
+ await poolUtil.wipeFiles();
21620
+ } catch {
21621
+ }
21622
+ };
21623
+ const directoryPrefix = directory ? `${directory.replace(/\/$/, "")}/` : void 0;
21624
+ if (!directoryPrefix) {
21625
+ await wipePool();
21626
+ return;
21627
+ }
21628
+ let poolFiles = [];
21629
+ try {
21630
+ poolFiles = poolUtil.getFileNames?.() ?? [];
21631
+ } catch {
21632
+ poolFiles = [];
21633
+ }
21634
+ for (const name of poolFiles) {
21635
+ if (preserveDbFile && name === dbFileName) {
21636
+ continue;
21637
+ }
21638
+ if (relatedFiles.has(name)) {
21639
+ continue;
21640
+ }
21641
+ if (name.startsWith(directoryPrefix)) {
21642
+ try {
21643
+ poolUtil.unlink(name);
21644
+ } catch {
21645
+ }
21646
+ }
21590
21647
  }
21591
- return close();
21648
+ await wipePool();
21649
+ };
21650
+ let close = async () => {
21651
+ await closeInternal();
21652
+ const preserve = Boolean(directory);
21653
+ await cleanupPool("close", preserve);
21654
+ };
21655
+ let drop = async () => {
21656
+ await closeInternal();
21657
+ await cleanupPool("drop", false);
21592
21658
  };
21593
21659
  let open = async () => {
21594
21660
  if (sqliteDb) {
@@ -21841,7 +21907,7 @@ var encodeName = (name) => {
21841
21907
  };
21842
21908
  var create3 = async (directory) => {
21843
21909
  const db = await create2(directory);
21844
- return new SQLiteIndices({ db });
21910
+ return new SQLiteIndices({ db, directory });
21845
21911
  };
21846
21912
  export {
21847
21913
  SQLLiteIndex,