pythonlib 1.0.2 → 2.0.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.
Files changed (133) hide show
  1. package/README.md +123 -49
  2. package/dist/base64-C_am75Sv.d.ts +165 -0
  3. package/dist/base64.d.ts +1 -0
  4. package/dist/base64.js +37 -0
  5. package/dist/chunk-2QEMKE7U.js +252 -0
  6. package/dist/chunk-2YTO24B5.js +78 -0
  7. package/dist/chunk-3HQSBCEC.js +348 -0
  8. package/dist/{chunk-7BZB2TQF.js → chunk-3M3PB4RO.js} +4 -6
  9. package/dist/chunk-5OKGPZBQ.js +1106 -0
  10. package/dist/chunk-B5LQJODJ.js +37 -0
  11. package/dist/{chunk-CUP6EPDB.js → chunk-BCMGGBWG.js} +2 -5
  12. package/dist/chunk-BCVIH2BN.js +175 -0
  13. package/dist/chunk-CANUXHVB.js +349 -0
  14. package/dist/{chunk-QURVRHY2.js → chunk-D35YI363.js} +15 -12
  15. package/dist/{chunk-RSBRI27Z.js → chunk-ETBW6XNR.js} +3 -4
  16. package/dist/chunk-HSTC277I.js +255 -0
  17. package/dist/chunk-HTCQ4OO5.js +238 -0
  18. package/dist/chunk-IANXD4D4.js +250 -0
  19. package/dist/{chunk-G6PUQTVZ.js → chunk-JAUU3HMH.js} +1 -2
  20. package/dist/chunk-JVTQM7CI.js +195 -0
  21. package/dist/chunk-KKJHGY4C.js +551 -0
  22. package/dist/chunk-LHPQS75Z.js +192 -0
  23. package/dist/{chunk-OSX7QZAW.js → chunk-LK2L2TFG.js} +5 -6
  24. package/dist/{chunk-CEZSBJJV.js → chunk-LWYBTWBZ.js} +2 -3
  25. package/dist/chunk-MEEU4SH5.js +362 -0
  26. package/dist/{chunk-TAYRRHJ3.js → chunk-MFKIEN7N.js} +1 -2
  27. package/dist/{chunk-PZ5AY32C.js → chunk-MLKGABMK.js} +0 -1
  28. package/dist/chunk-OZRS5PC4.js +312 -0
  29. package/dist/chunk-PVK4F3ME.js +194 -0
  30. package/dist/{chunk-56DGFWIJ.js → chunk-QKJBQKPY.js} +1 -2
  31. package/dist/chunk-RB6BYCIQ.js +141 -0
  32. package/dist/chunk-RRSOZXZE.js +155 -0
  33. package/dist/chunk-THMJVAK6.js +282 -0
  34. package/dist/chunk-UGZ5OY5Z.js +165 -0
  35. package/dist/chunk-WTZSAITC.js +82 -0
  36. package/dist/chunk-YONWJHJU.js +265 -0
  37. package/dist/collections.js +2 -3
  38. package/dist/copy-6ZaZ__ge.d.ts +59 -0
  39. package/dist/copy.d.ts +1 -0
  40. package/dist/copy.js +9 -0
  41. package/dist/datetime.js +2 -3
  42. package/dist/functools.js +2 -3
  43. package/dist/glob.browser-B6d_YdV5.d.ts +50 -0
  44. package/dist/glob.browser.d.ts +1 -0
  45. package/dist/glob.browser.js +15 -0
  46. package/dist/glob.node-wn5ehtyM.d.ts +80 -0
  47. package/dist/glob.node.d.ts +1 -0
  48. package/dist/glob.node.js +15 -0
  49. package/dist/hashlib-vKP511NY.d.ts +205 -0
  50. package/dist/hashlib.d.ts +1 -0
  51. package/dist/hashlib.js +39 -0
  52. package/dist/index.browser.d.ts +172 -0
  53. package/dist/index.browser.js +305 -0
  54. package/dist/index.d.ts +36 -602
  55. package/dist/index.js +138 -1073
  56. package/dist/itertools.js +2 -3
  57. package/dist/json.js +2 -3
  58. package/dist/logging.browser-Dux4L5kz.d.ts +185 -0
  59. package/dist/logging.browser.d.ts +1 -0
  60. package/dist/logging.browser.js +63 -0
  61. package/dist/logging.node-CH75bVdE.d.ts +185 -0
  62. package/dist/logging.node.d.ts +1 -0
  63. package/dist/logging.node.js +61 -0
  64. package/dist/math.js +2 -3
  65. package/dist/{os-CqGKe872.d.ts → os.browser-krjSx5kF.d.ts} +32 -55
  66. package/dist/os.browser.d.ts +2 -0
  67. package/dist/{os.js → os.browser.js} +41 -16
  68. package/dist/os.node-CQjch8Ht.d.ts +124 -0
  69. package/dist/os.node.d.ts +2 -0
  70. package/dist/os.node.js +83 -0
  71. package/dist/os.shared-C3x70nhO.d.ts +59 -0
  72. package/dist/pathlib.browser-NC7kKQYe.d.ts +91 -0
  73. package/dist/pathlib.browser.d.ts +1 -0
  74. package/dist/pathlib.browser.js +17 -0
  75. package/dist/pathlib.node-CY3yUFdT.d.ts +331 -0
  76. package/dist/pathlib.node.d.ts +2 -0
  77. package/dist/pathlib.node.js +17 -0
  78. package/dist/random.js +2 -3
  79. package/dist/re.js +2 -3
  80. package/dist/set-JQbLAq8B.d.ts +592 -0
  81. package/dist/shutil.browser-Ck5oWhnP.d.ts +113 -0
  82. package/dist/shutil.browser.d.ts +1 -0
  83. package/dist/shutil.browser.js +33 -0
  84. package/dist/shutil.node-C9kwvhAf.d.ts +160 -0
  85. package/dist/shutil.node.d.ts +2 -0
  86. package/dist/shutil.node.js +33 -0
  87. package/dist/string.js +2 -3
  88. package/dist/subprocess-CZVYzQ3V.d.ts +214 -0
  89. package/dist/subprocess.d.ts +1 -0
  90. package/dist/subprocess.js +29 -0
  91. package/dist/sys-IL8LgI_W.d.ts +212 -0
  92. package/dist/sys.d.ts +1 -0
  93. package/dist/sys.js +51 -0
  94. package/dist/tempfile.browser-DciOKfNm.d.ts +78 -0
  95. package/dist/tempfile.browser.d.ts +1 -0
  96. package/dist/tempfile.browser.js +19 -0
  97. package/dist/tempfile.node-bVMY60Cu.d.ts +195 -0
  98. package/dist/tempfile.node.d.ts +2 -0
  99. package/dist/tempfile.node.js +23 -0
  100. package/dist/time-CcYhdiSu.d.ts +245 -0
  101. package/dist/time.d.ts +1 -0
  102. package/dist/time.js +49 -0
  103. package/dist/urllib-DJtkj-0f.d.ts +198 -0
  104. package/dist/urllib.d.ts +1 -0
  105. package/dist/urllib.js +37 -0
  106. package/dist/uuid-C0ypmn56.d.ts +160 -0
  107. package/dist/uuid.d.ts +1 -0
  108. package/dist/uuid.js +23 -0
  109. package/package.json +128 -5
  110. package/dist/chunk-56DGFWIJ.js.map +0 -1
  111. package/dist/chunk-5AOJFFYN.js +0 -313
  112. package/dist/chunk-5AOJFFYN.js.map +0 -1
  113. package/dist/chunk-7BZB2TQF.js.map +0 -1
  114. package/dist/chunk-CEZSBJJV.js.map +0 -1
  115. package/dist/chunk-CUP6EPDB.js.map +0 -1
  116. package/dist/chunk-G6PUQTVZ.js.map +0 -1
  117. package/dist/chunk-OSX7QZAW.js.map +0 -1
  118. package/dist/chunk-PZ5AY32C.js.map +0 -1
  119. package/dist/chunk-QURVRHY2.js.map +0 -1
  120. package/dist/chunk-RSBRI27Z.js.map +0 -1
  121. package/dist/chunk-TAYRRHJ3.js.map +0 -1
  122. package/dist/collections.js.map +0 -1
  123. package/dist/datetime.js.map +0 -1
  124. package/dist/functools.js.map +0 -1
  125. package/dist/index.js.map +0 -1
  126. package/dist/itertools.js.map +0 -1
  127. package/dist/json.js.map +0 -1
  128. package/dist/math.js.map +0 -1
  129. package/dist/os.d.ts +0 -1
  130. package/dist/os.js.map +0 -1
  131. package/dist/random.js.map +0 -1
  132. package/dist/re.js.map +0 -1
  133. package/dist/string.js.map +0 -1
@@ -0,0 +1,265 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-MLKGABMK.js";
4
+
5
+ // src/hashlib.ts
6
+ var hashlib_exports = {};
7
+ __export(hashlib_exports, {
8
+ algorithmsAvailable: () => algorithmsAvailable,
9
+ algorithmsGuaranteed: () => algorithmsGuaranteed,
10
+ blake2b: () => blake2b,
11
+ blake2s: () => blake2s,
12
+ compareDigest: () => compareDigest,
13
+ fileDigest: () => fileDigest,
14
+ md5: () => md5,
15
+ newHash: () => newHash,
16
+ pbkdf2Hmac: () => pbkdf2Hmac,
17
+ scrypt: () => scrypt,
18
+ sha1: () => sha1,
19
+ sha224: () => sha224,
20
+ sha256: () => sha256,
21
+ sha384: () => sha384,
22
+ sha3_256: () => sha3_256,
23
+ sha3_512: () => sha3_512,
24
+ sha512: () => sha512
25
+ });
26
+ var ALGORITHM_INFO = {
27
+ md5: { digestSize: 16, blockSize: 64 },
28
+ // Not in Web Crypto
29
+ sha1: { digestSize: 20, blockSize: 64, webCryptoName: "SHA-1" },
30
+ sha224: { digestSize: 28, blockSize: 64 },
31
+ // Not in Web Crypto
32
+ sha256: { digestSize: 32, blockSize: 64, webCryptoName: "SHA-256" },
33
+ sha384: { digestSize: 48, blockSize: 128, webCryptoName: "SHA-384" },
34
+ sha512: { digestSize: 64, blockSize: 128, webCryptoName: "SHA-512" },
35
+ "sha3-256": { digestSize: 32, blockSize: 136 },
36
+ // Not in Web Crypto
37
+ "sha3-512": { digestSize: 64, blockSize: 72 },
38
+ // Not in Web Crypto
39
+ blake2b512: { digestSize: 64, blockSize: 128 },
40
+ // Not in Web Crypto
41
+ blake2s256: { digestSize: 32, blockSize: 64 }
42
+ // Not in Web Crypto
43
+ };
44
+ var isNode = typeof process !== "undefined" && typeof process.versions?.node === "string";
45
+ var nodeCrypto;
46
+ async function getNodeCrypto() {
47
+ nodeCrypto ??= await import("crypto");
48
+ return nodeCrypto;
49
+ }
50
+ function stringToBytes(str) {
51
+ return new TextEncoder().encode(str);
52
+ }
53
+ function bytesToHex(bytes) {
54
+ return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
55
+ }
56
+ function createHashObject(algorithm, initialData) {
57
+ const normalizedAlgorithm = algorithm.toLowerCase();
58
+ const info = ALGORITHM_INFO[normalizedAlgorithm] ?? { digestSize: 32, blockSize: 64 };
59
+ const dataChunks = [];
60
+ if (initialData) {
61
+ dataChunks.push(initialData);
62
+ }
63
+ const hashObject = {
64
+ name: normalizedAlgorithm,
65
+ digestSize: info.digestSize,
66
+ blockSize: info.blockSize,
67
+ update(data) {
68
+ const bytes = typeof data === "string" ? stringToBytes(data) : data;
69
+ dataChunks.push(bytes);
70
+ },
71
+ async digest() {
72
+ const totalLength = dataChunks.reduce((sum, chunk) => sum + chunk.length, 0);
73
+ const allData = new Uint8Array(totalLength);
74
+ let offset = 0;
75
+ for (const chunk of dataChunks) {
76
+ allData.set(chunk, offset);
77
+ offset += chunk.length;
78
+ }
79
+ if (isNode) {
80
+ const crypto2 = await getNodeCrypto();
81
+ const hash = crypto2.createHash(normalizedAlgorithm);
82
+ hash.update(allData);
83
+ return new Uint8Array(hash.digest());
84
+ } else {
85
+ const webCryptoName = info.webCryptoName;
86
+ if (!webCryptoName) {
87
+ throw new Error(
88
+ `Algorithm "${normalizedAlgorithm}" is not available in Web Crypto API. Available algorithms: SHA-1, SHA-256, SHA-384, SHA-512`
89
+ );
90
+ }
91
+ const hashBuffer = await crypto.subtle.digest(webCryptoName, allData);
92
+ return new Uint8Array(hashBuffer);
93
+ }
94
+ },
95
+ async hexdigest() {
96
+ const digestBytes = await this.digest();
97
+ return bytesToHex(digestBytes);
98
+ },
99
+ copy() {
100
+ const totalLength = dataChunks.reduce((sum, chunk) => sum + chunk.length, 0);
101
+ const allData = new Uint8Array(totalLength);
102
+ let offset = 0;
103
+ for (const chunk of dataChunks) {
104
+ allData.set(chunk, offset);
105
+ offset += chunk.length;
106
+ }
107
+ return createHashObject(algorithm, allData);
108
+ }
109
+ };
110
+ return hashObject;
111
+ }
112
+ function newHash(name, data) {
113
+ const hash = createHashObject(name);
114
+ if (data !== void 0) {
115
+ hash.update(data);
116
+ }
117
+ return hash;
118
+ }
119
+ function md5(data) {
120
+ return newHash("md5", data);
121
+ }
122
+ function sha1(data) {
123
+ return newHash("sha1", data);
124
+ }
125
+ function sha224(data) {
126
+ return newHash("sha224", data);
127
+ }
128
+ function sha256(data) {
129
+ return newHash("sha256", data);
130
+ }
131
+ function sha384(data) {
132
+ return newHash("sha384", data);
133
+ }
134
+ function sha512(data) {
135
+ return newHash("sha512", data);
136
+ }
137
+ function sha3_256(data) {
138
+ return newHash("sha3-256", data);
139
+ }
140
+ function sha3_512(data) {
141
+ return newHash("sha3-512", data);
142
+ }
143
+ function blake2b(data) {
144
+ return newHash("blake2b512", data);
145
+ }
146
+ function blake2s(data) {
147
+ return newHash("blake2s256", data);
148
+ }
149
+ var algorithmsAvailable = /* @__PURE__ */ new Set([
150
+ "md5",
151
+ "sha1",
152
+ "sha224",
153
+ "sha256",
154
+ "sha384",
155
+ "sha512",
156
+ "sha3-256",
157
+ "sha3-512",
158
+ "blake2b512",
159
+ "blake2s256"
160
+ ]);
161
+ var algorithmsGuaranteed = /* @__PURE__ */ new Set(["sha1", "sha256", "sha384", "sha512"]);
162
+ async function pbkdf2Hmac(hashName, password, salt, iterations, dklen) {
163
+ const passwordBytes = typeof password === "string" ? stringToBytes(password) : password;
164
+ const saltBytes = typeof salt === "string" ? stringToBytes(salt) : salt;
165
+ if (isNode) {
166
+ const crypto2 = await getNodeCrypto();
167
+ return new Uint8Array(crypto2.pbkdf2Sync(passwordBytes, saltBytes, iterations, dklen, hashName));
168
+ } else {
169
+ const info = ALGORITHM_INFO[hashName.toLowerCase()];
170
+ const webCryptoName = info?.webCryptoName;
171
+ if (!webCryptoName) {
172
+ throw new Error(`Algorithm "${hashName}" is not available in Web Crypto API`);
173
+ }
174
+ const keyMaterial = await crypto.subtle.importKey("raw", passwordBytes, "PBKDF2", false, [
175
+ "deriveBits"
176
+ ]);
177
+ const derivedBits = await crypto.subtle.deriveBits(
178
+ {
179
+ name: "PBKDF2",
180
+ salt: saltBytes,
181
+ iterations,
182
+ hash: webCryptoName
183
+ },
184
+ keyMaterial,
185
+ dklen * 8
186
+ );
187
+ return new Uint8Array(derivedBits);
188
+ }
189
+ }
190
+ async function scrypt(password, salt, n, r, p, dklen) {
191
+ if (!isNode) {
192
+ throw new Error("scrypt is only available in Node.js, not in browser environments");
193
+ }
194
+ const crypto2 = await getNodeCrypto();
195
+ const passwordBytes = typeof password === "string" ? stringToBytes(password) : password;
196
+ const saltBytes = typeof salt === "string" ? stringToBytes(salt) : salt;
197
+ return new Uint8Array(
198
+ crypto2.scryptSync(passwordBytes, saltBytes, dklen, {
199
+ N: n,
200
+ r,
201
+ p
202
+ })
203
+ );
204
+ }
205
+ async function compareDigest(a, b) {
206
+ const aBytes = typeof a === "string" ? stringToBytes(a) : a;
207
+ const bBytes = typeof b === "string" ? stringToBytes(b) : b;
208
+ if (aBytes.length !== bBytes.length) {
209
+ return false;
210
+ }
211
+ if (isNode) {
212
+ const crypto2 = await getNodeCrypto();
213
+ return crypto2.timingSafeEqual(aBytes, bBytes);
214
+ } else {
215
+ let result = 0;
216
+ for (let i = 0; i < aBytes.length; i++) {
217
+ const aByte = aBytes[i] ?? 0;
218
+ const bByte = bBytes[i] ?? 0;
219
+ result |= aByte ^ bByte;
220
+ }
221
+ return result === 0;
222
+ }
223
+ }
224
+ async function fileDigest(path, algorithm = "sha256") {
225
+ if (!isNode) {
226
+ throw new Error("fileDigest is only available in Node.js");
227
+ }
228
+ const crypto2 = await getNodeCrypto();
229
+ const fs = await import("fs");
230
+ return new Promise((resolve, reject) => {
231
+ const hash = crypto2.createHash(algorithm);
232
+ const stream = fs.createReadStream(path);
233
+ stream.on("data", (data) => {
234
+ hash.update(data);
235
+ });
236
+ stream.on("end", () => {
237
+ resolve(hash.digest("hex"));
238
+ });
239
+ stream.on("error", reject);
240
+ });
241
+ }
242
+
243
+ export {
244
+ newHash,
245
+ md5,
246
+ sha1,
247
+ sha224,
248
+ sha256,
249
+ sha384,
250
+ sha512,
251
+ sha3_256,
252
+ sha3_512,
253
+ blake2b,
254
+ blake2s,
255
+ algorithmsAvailable,
256
+ algorithmsGuaranteed,
257
+ pbkdf2Hmac,
258
+ scrypt,
259
+ compareDigest,
260
+ fileDigest,
261
+ hashlib_exports
262
+ };
263
+ /* v8 ignore start -- browser Web Crypto API path @preserve */
264
+ /* v8 ignore next 3 -- browser error path @preserve */
265
+ /* v8 ignore start -- browser fallback path @preserve */
@@ -2,11 +2,10 @@ import {
2
2
  Counter,
3
3
  defaultdict,
4
4
  deque
5
- } from "./chunk-TAYRRHJ3.js";
6
- import "./chunk-PZ5AY32C.js";
5
+ } from "./chunk-MFKIEN7N.js";
6
+ import "./chunk-MLKGABMK.js";
7
7
  export {
8
8
  Counter,
9
9
  defaultdict,
10
10
  deque
11
11
  };
12
- //# sourceMappingURL=collections.js.map
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Python copy module for TypeScript
3
+ *
4
+ * Provides shallow and deep copy operations.
5
+ *
6
+ * @see {@link https://docs.python.org/3/library/copy.html | Python copy documentation}
7
+ * @module
8
+ */
9
+ /**
10
+ * Create a shallow copy of an object.
11
+ *
12
+ * For primitive types, returns the value as-is.
13
+ * For arrays, returns a new array with the same elements.
14
+ * For objects, returns a new object with the same properties.
15
+ * For Maps and Sets, returns new instances with the same entries.
16
+ *
17
+ * @param x - The object to copy
18
+ * @returns A shallow copy of x
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * const original = [1, [2, 3], 4]
23
+ * const copied = copy(original)
24
+ * copied[0] = 99
25
+ * console.log(original[0]) // 1 (unchanged)
26
+ * copied[1][0] = 99
27
+ * console.log(original[1][0]) // 99 (nested array is shared)
28
+ * ```
29
+ */
30
+ declare function copy<T>(x: T): T;
31
+ /**
32
+ * Create a deep copy of an object.
33
+ *
34
+ * Creates a complete independent copy of the object and all nested objects.
35
+ * Uses structuredClone when available, with a fallback for older environments.
36
+ *
37
+ * Note: Functions cannot be deep copied and will be shared between copies.
38
+ *
39
+ * @param x - The object to deep copy
40
+ * @param memo - Internal map for circular reference handling (optional)
41
+ * @returns A deep copy of x
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * const original = { a: 1, b: { c: 2 } }
46
+ * const copied = deepcopy(original)
47
+ * copied.b.c = 99
48
+ * console.log(original.b.c) // 2 (unchanged)
49
+ * ```
50
+ */
51
+ declare function deepcopy<T>(x: T, memo?: Map<unknown, unknown>): T;
52
+
53
+ declare const copyModule_copy: typeof copy;
54
+ declare const copyModule_deepcopy: typeof deepcopy;
55
+ declare namespace copyModule {
56
+ export { copyModule_copy as copy, copyModule_deepcopy as deepcopy };
57
+ }
58
+
59
+ export { copy as a, copyModule as c, deepcopy as d };
package/dist/copy.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { a as copy, d as deepcopy } from './copy-6ZaZ__ge.js';
package/dist/copy.js ADDED
@@ -0,0 +1,9 @@
1
+ import {
2
+ copy,
3
+ deepcopy
4
+ } from "./chunk-RRSOZXZE.js";
5
+ import "./chunk-MLKGABMK.js";
6
+ export {
7
+ copy,
8
+ deepcopy
9
+ };
package/dist/datetime.js CHANGED
@@ -7,8 +7,8 @@ import {
7
7
  strptime,
8
8
  time,
9
9
  timedelta
10
- } from "./chunk-OSX7QZAW.js";
11
- import "./chunk-PZ5AY32C.js";
10
+ } from "./chunk-LK2L2TFG.js";
11
+ import "./chunk-MLKGABMK.js";
12
12
  export {
13
13
  MAXYEAR,
14
14
  MINYEAR,
@@ -19,4 +19,3 @@ export {
19
19
  time,
20
20
  timedelta
21
21
  };
22
- //# sourceMappingURL=datetime.js.map
package/dist/functools.js CHANGED
@@ -13,8 +13,8 @@ import {
13
13
  singleDispatch,
14
14
  totalOrdering,
15
15
  wraps
16
- } from "./chunk-QURVRHY2.js";
17
- import "./chunk-PZ5AY32C.js";
16
+ } from "./chunk-D35YI363.js";
17
+ import "./chunk-MLKGABMK.js";
18
18
  export {
19
19
  attrGetter,
20
20
  cache,
@@ -31,4 +31,3 @@ export {
31
31
  totalOrdering,
32
32
  wraps
33
33
  };
34
- //# sourceMappingURL=functools.js.map
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Python glob module for TypeScript - Browser version
3
+ *
4
+ * Browser stub - filesystem operations are not available.
5
+ *
6
+ * @see {@link https://docs.python.org/3/library/glob.html | Python glob documentation}
7
+ * @module
8
+ */
9
+ /**
10
+ * Return a list of paths matching a pathname pattern.
11
+ * Browser stub - always returns empty array.
12
+ */
13
+ declare function glob(_pattern: string, _options?: {
14
+ recursive?: boolean;
15
+ rootDir?: string;
16
+ includeHidden?: boolean;
17
+ }): Promise<string[]>;
18
+ /**
19
+ * Return an async iterator of paths matching a pathname pattern.
20
+ * Browser stub - yields nothing.
21
+ */
22
+ declare function iglob(_pattern: string, _options?: {
23
+ recursive?: boolean;
24
+ rootDir?: string;
25
+ includeHidden?: boolean;
26
+ }): AsyncGenerator<string>;
27
+ /**
28
+ * Escape all special characters in a pathname.
29
+ */
30
+ declare function escape(pathname: string): string;
31
+ /**
32
+ * Return true if the pattern contains any magic glob characters.
33
+ */
34
+ declare function hasMagic(pattern: string): boolean;
35
+ /**
36
+ * Return a list of all files matching pattern recursively.
37
+ * Browser stub - always returns empty array.
38
+ */
39
+ declare function rglob(_pattern: string, _rootDir?: string): Promise<string[]>;
40
+
41
+ declare const globModule_escape: typeof escape;
42
+ declare const globModule_glob: typeof glob;
43
+ declare const globModule_hasMagic: typeof hasMagic;
44
+ declare const globModule_iglob: typeof iglob;
45
+ declare const globModule_rglob: typeof rglob;
46
+ declare namespace globModule {
47
+ export { globModule_escape as escape, globModule_glob as glob, globModule_hasMagic as hasMagic, globModule_iglob as iglob, globModule_rglob as rglob };
48
+ }
49
+
50
+ export { glob as a, escape as e, globModule as g, hasMagic as h, iglob as i, rglob as r };
@@ -0,0 +1 @@
1
+ export { e as escape, a as glob, h as hasMagic, i as iglob, r as rglob } from './glob.browser-B6d_YdV5.js';
@@ -0,0 +1,15 @@
1
+ import {
2
+ escape,
3
+ glob,
4
+ hasMagic,
5
+ iglob,
6
+ rglob
7
+ } from "./chunk-B5LQJODJ.js";
8
+ import "./chunk-MLKGABMK.js";
9
+ export {
10
+ escape,
11
+ glob,
12
+ hasMagic,
13
+ iglob,
14
+ rglob
15
+ };
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Python glob module for TypeScript
3
+ *
4
+ * Provides Unix shell-style pathname pattern matching with async operations.
5
+ *
6
+ * @see {@link https://docs.python.org/3/library/glob.html | Python glob documentation}
7
+ * @module
8
+ */
9
+ /**
10
+ * Return a list of paths matching a pathname pattern.
11
+ *
12
+ * The pattern may contain shell-style wildcards:
13
+ * - `*` matches any number of characters
14
+ * - `?` matches a single character
15
+ * - `[seq]` matches any character in seq
16
+ * - `[!seq]` matches any character not in seq
17
+ * - `**` matches everything, including any subdirectories
18
+ *
19
+ * @param pattern - The glob pattern
20
+ * @param options - Options object
21
+ * @returns Promise of array of matching paths
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * await glob("*.txt") // All .txt files in current directory
26
+ * await glob("**\/*.py") // All .py files recursively
27
+ * await glob("/path/to/*.js") // All .js files in /path/to
28
+ * ```
29
+ */
30
+ declare function glob(pattern: string, options?: {
31
+ recursive?: boolean;
32
+ rootDir?: string;
33
+ includeHidden?: boolean;
34
+ }): Promise<string[]>;
35
+ /**
36
+ * Return an async iterator of paths matching a pathname pattern.
37
+ *
38
+ * @param pattern - The glob pattern
39
+ * @param options - Options object
40
+ * @returns AsyncGenerator of matching paths
41
+ */
42
+ declare function iglob(pattern: string, options?: {
43
+ recursive?: boolean;
44
+ rootDir?: string;
45
+ includeHidden?: boolean;
46
+ }): AsyncGenerator<string>;
47
+ /**
48
+ * Escape all special characters in a pathname.
49
+ *
50
+ * @param pathname - The path to escape
51
+ * @returns Escaped path safe for use in glob patterns
52
+ */
53
+ declare function escape(pathname: string): string;
54
+ /**
55
+ * Return true if the pattern contains any magic glob characters.
56
+ *
57
+ * @param pattern - The pattern to check
58
+ * @returns True if pattern contains wildcards
59
+ */
60
+ declare function hasMagic(pattern: string): boolean;
61
+ /**
62
+ * Return a list of all files matching pattern in directory and subdirectories.
63
+ * This is an alias for glob with recursive=true.
64
+ *
65
+ * @param pattern - The glob pattern (without **)
66
+ * @param rootDir - Root directory to search from
67
+ * @returns Promise of array of matching paths
68
+ */
69
+ declare function rglob(pattern: string, rootDir?: string): Promise<string[]>;
70
+
71
+ declare const globModule_escape: typeof escape;
72
+ declare const globModule_glob: typeof glob;
73
+ declare const globModule_hasMagic: typeof hasMagic;
74
+ declare const globModule_iglob: typeof iglob;
75
+ declare const globModule_rglob: typeof rglob;
76
+ declare namespace globModule {
77
+ export { globModule_escape as escape, globModule_glob as glob, globModule_hasMagic as hasMagic, globModule_iglob as iglob, globModule_rglob as rglob };
78
+ }
79
+
80
+ export { glob as a, escape as e, globModule as g, hasMagic as h, iglob as i, rglob as r };
@@ -0,0 +1 @@
1
+ export { e as escape, a as glob, h as hasMagic, i as iglob, r as rglob } from './glob.node-wn5ehtyM.js';
@@ -0,0 +1,15 @@
1
+ import {
2
+ escape,
3
+ glob,
4
+ hasMagic,
5
+ iglob,
6
+ rglob
7
+ } from "./chunk-RB6BYCIQ.js";
8
+ import "./chunk-MLKGABMK.js";
9
+ export {
10
+ escape,
11
+ glob,
12
+ hasMagic,
13
+ iglob,
14
+ rglob
15
+ };