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,312 @@
1
+ import {
2
+ altSep,
3
+ chdir,
4
+ curDir,
5
+ environ,
6
+ extSep,
7
+ getCwd,
8
+ getCwdb,
9
+ getenv,
10
+ lineSep,
11
+ name,
12
+ parDir,
13
+ pathBasename,
14
+ pathCommonPath,
15
+ pathDirname,
16
+ pathExpandUser,
17
+ pathExpandVars,
18
+ pathExtName,
19
+ pathIsAbs,
20
+ pathJoin,
21
+ pathNormPath,
22
+ pathRelPath,
23
+ pathSep,
24
+ pathSplitExt,
25
+ pathSplitFn,
26
+ sep
27
+ } from "./chunk-LHPQS75Z.js";
28
+ import {
29
+ __export
30
+ } from "./chunk-MLKGABMK.js";
31
+
32
+ // src/os.node.ts
33
+ var os_node_exports = {};
34
+ __export(os_node_exports, {
35
+ altSep: () => altSep,
36
+ chdir: () => chdir,
37
+ curDir: () => curDir,
38
+ environ: () => environ,
39
+ extSep: () => extSep,
40
+ getCwd: () => getCwd,
41
+ getCwdb: () => getCwdb,
42
+ getenv: () => getenv,
43
+ lineSep: () => lineSep,
44
+ listDir: () => listDir,
45
+ makeDirs: () => makeDirs,
46
+ mkdir: () => mkdir,
47
+ name: () => name,
48
+ parDir: () => parDir,
49
+ path: () => path,
50
+ pathBasename: () => pathBasename,
51
+ pathCommonPath: () => pathCommonPath,
52
+ pathDirname: () => pathDirname,
53
+ pathExpandUser: () => pathExpandUser,
54
+ pathExpandVars: () => pathExpandVars,
55
+ pathExtName: () => pathExtName,
56
+ pathIsAbs: () => pathIsAbs,
57
+ pathJoin: () => pathJoin,
58
+ pathNormPath: () => pathNormPath,
59
+ pathRelPath: () => pathRelPath,
60
+ pathSep: () => pathSep,
61
+ pathSplitExt: () => pathSplitExt,
62
+ pathSplitFn: () => pathSplitFn,
63
+ remove: () => remove,
64
+ removeDirs: () => removeDirs,
65
+ rename: () => rename,
66
+ renames: () => renames,
67
+ replace: () => replace,
68
+ rmdir: () => rmdir,
69
+ sep: () => sep,
70
+ stat: () => stat,
71
+ unlink: () => unlink,
72
+ walk: () => walk
73
+ });
74
+ import {
75
+ access,
76
+ lstat,
77
+ mkdir as fsMkdir,
78
+ readdir,
79
+ realpath,
80
+ rename as fsRename,
81
+ rmdir as fsRmdir,
82
+ stat as fsStat,
83
+ unlink as fsUnlink
84
+ } from "fs/promises";
85
+ import { join } from "path";
86
+ var path = {
87
+ join: pathJoin,
88
+ basename: pathBasename,
89
+ dirname: pathDirname,
90
+ split: pathSplitFn,
91
+ splitExt: pathSplitExt,
92
+ extName: pathExtName,
93
+ isAbs: pathIsAbs,
94
+ normPath: pathNormPath,
95
+ relPath: pathRelPath,
96
+ commonPath: pathCommonPath,
97
+ expandUser: pathExpandUser,
98
+ expandVars: pathExpandVars,
99
+ /** Return normalized absolutized version of pathname */
100
+ absPath(p) {
101
+ if (pathIsAbs(p)) {
102
+ return pathNormPath(p);
103
+ }
104
+ return pathNormPath(pathJoin(getCwd(), p));
105
+ },
106
+ /** Return canonical path, eliminating symlinks */
107
+ async realPath(p) {
108
+ try {
109
+ return await realpath(p);
110
+ } catch {
111
+ return path.absPath(p);
112
+ }
113
+ },
114
+ /** Test if path exists */
115
+ async exists(p) {
116
+ try {
117
+ await access(p);
118
+ return true;
119
+ } catch {
120
+ return false;
121
+ }
122
+ },
123
+ /** Test if path is a file */
124
+ async isFile(p) {
125
+ try {
126
+ return (await fsStat(p)).isFile();
127
+ } catch {
128
+ return false;
129
+ }
130
+ },
131
+ /** Test if path is a directory */
132
+ async isDir(p) {
133
+ try {
134
+ return (await fsStat(p)).isDirectory();
135
+ } catch {
136
+ return false;
137
+ }
138
+ },
139
+ /** Test if path is a symbolic link */
140
+ async isLink(p) {
141
+ try {
142
+ return (await lstat(p)).isSymbolicLink();
143
+ } catch {
144
+ return false;
145
+ }
146
+ },
147
+ /** Return size of file */
148
+ async getSize(p) {
149
+ try {
150
+ return (await fsStat(p)).size;
151
+ } catch {
152
+ return 0;
153
+ }
154
+ },
155
+ /** Return modification time as Unix timestamp */
156
+ async getMtime(p) {
157
+ try {
158
+ return Math.floor((await fsStat(p)).mtimeMs / 1e3);
159
+ } catch {
160
+ return 0;
161
+ }
162
+ },
163
+ /** Return access time as Unix timestamp */
164
+ async getAtime(p) {
165
+ try {
166
+ return Math.floor((await fsStat(p)).atimeMs / 1e3);
167
+ } catch {
168
+ return 0;
169
+ }
170
+ },
171
+ /** Return creation time as Unix timestamp */
172
+ async getCtime(p) {
173
+ try {
174
+ return Math.floor((await fsStat(p)).ctimeMs / 1e3);
175
+ } catch {
176
+ return 0;
177
+ }
178
+ }
179
+ };
180
+ async function listDir(p = ".") {
181
+ try {
182
+ return await readdir(p);
183
+ } catch {
184
+ return [];
185
+ }
186
+ }
187
+ async function mkdir(p, mode = 511) {
188
+ await fsMkdir(p, { mode });
189
+ }
190
+ async function makeDirs(p, mode = 511, existOk = false) {
191
+ try {
192
+ await fsMkdir(p, { recursive: true, mode });
193
+ } catch (e) {
194
+ if (!existOk || !(e instanceof Error && "code" in e && e.code === "EEXIST")) {
195
+ throw e;
196
+ }
197
+ }
198
+ }
199
+ async function remove(p) {
200
+ await fsUnlink(p);
201
+ }
202
+ var unlink = remove;
203
+ async function rmdir(p) {
204
+ await fsRmdir(p);
205
+ }
206
+ async function removeDirs(p) {
207
+ await fsRmdir(p);
208
+ let parent = pathDirname(p);
209
+ while (parent && parent !== p) {
210
+ try {
211
+ await fsRmdir(parent);
212
+ p = parent;
213
+ parent = pathDirname(p);
214
+ } catch {
215
+ break;
216
+ }
217
+ }
218
+ }
219
+ async function rename(src, dst) {
220
+ await fsRename(src, dst);
221
+ }
222
+ async function renames(src, dst) {
223
+ const dstDir = pathDirname(dst);
224
+ if (dstDir) {
225
+ await makeDirs(dstDir, 511, true);
226
+ }
227
+ await rename(src, dst);
228
+ const srcDir = pathDirname(src);
229
+ if (srcDir) {
230
+ try {
231
+ await removeDirs(srcDir);
232
+ } catch {
233
+ }
234
+ }
235
+ }
236
+ async function replace(src, dst) {
237
+ await fsRename(src, dst);
238
+ }
239
+ async function* walk(top, options) {
240
+ const topdown = options?.topdown ?? true;
241
+ const followlinks = options?.followlinks ?? false;
242
+ const dirs = [];
243
+ const files = [];
244
+ try {
245
+ const entries = await readdir(top, { withFileTypes: true });
246
+ for (const entry of entries) {
247
+ if (entry.isDirectory()) {
248
+ dirs.push(entry.name);
249
+ } else if (entry.isFile()) {
250
+ files.push(entry.name);
251
+ } else if (entry.isSymbolicLink()) {
252
+ if (followlinks) {
253
+ try {
254
+ const realPath = await realpath(join(top, entry.name));
255
+ if ((await fsStat(realPath)).isDirectory()) {
256
+ dirs.push(entry.name);
257
+ } else {
258
+ files.push(entry.name);
259
+ }
260
+ } catch {
261
+ files.push(entry.name);
262
+ }
263
+ } else {
264
+ files.push(entry.name);
265
+ }
266
+ }
267
+ }
268
+ } catch {
269
+ return;
270
+ }
271
+ if (topdown) {
272
+ yield [top, dirs, files];
273
+ }
274
+ for (const dir of dirs) {
275
+ const dirPath = join(top, dir);
276
+ yield* walk(dirPath, options);
277
+ }
278
+ if (!topdown) {
279
+ yield [top, dirs, files];
280
+ }
281
+ }
282
+ async function stat(p) {
283
+ try {
284
+ const s = await fsStat(p);
285
+ return {
286
+ st_mode: s.mode,
287
+ st_size: s.size,
288
+ st_mtime: Math.floor(s.mtimeMs / 1e3),
289
+ st_atime: Math.floor(s.atimeMs / 1e3),
290
+ st_ctime: Math.floor(s.ctimeMs / 1e3)
291
+ };
292
+ } catch {
293
+ return { st_mode: 0, st_size: 0, st_mtime: 0, st_atime: 0, st_ctime: 0 };
294
+ }
295
+ }
296
+
297
+ export {
298
+ path,
299
+ listDir,
300
+ mkdir,
301
+ makeDirs,
302
+ remove,
303
+ unlink,
304
+ rmdir,
305
+ removeDirs,
306
+ rename,
307
+ renames,
308
+ replace,
309
+ walk,
310
+ stat,
311
+ os_node_exports
312
+ };
@@ -0,0 +1,194 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-MLKGABMK.js";
4
+
5
+ // src/sys.ts
6
+ var sys_exports = {};
7
+ __export(sys_exports, {
8
+ apiVersion: () => apiVersion,
9
+ argv: () => argv,
10
+ byteorder: () => byteorder,
11
+ executable: () => executable,
12
+ exit: () => exit,
13
+ floatInfo: () => floatInfo,
14
+ getDefaultEncoding: () => getDefaultEncoding,
15
+ getFilesystemEncoding: () => getFilesystemEncoding,
16
+ getRecursionLimit: () => getRecursionLimit,
17
+ getRefCount: () => getRefCount,
18
+ getSizeOf: () => getSizeOf,
19
+ hashInfo: () => hashInfo,
20
+ intInfo: () => intInfo,
21
+ maxsize: () => maxsize,
22
+ path: () => path,
23
+ platform: () => platform,
24
+ prefix: () => prefix,
25
+ setRecursionLimit: () => setRecursionLimit,
26
+ stderr: () => stderr,
27
+ stdin: () => stdin,
28
+ stdout: () => stdout,
29
+ version: () => version,
30
+ versionInfo: () => versionInfo
31
+ });
32
+ var argv = typeof process !== "undefined" ? process.argv.slice(2) : [];
33
+ var platform = typeof process !== "undefined" ? process.platform : "unknown";
34
+ var version = "3.11.0 (pythonlib TypeScript implementation)";
35
+ var versionInfo = {
36
+ major: 3,
37
+ minor: 11,
38
+ micro: 0,
39
+ releaselevel: "final",
40
+ serial: 0,
41
+ // Make it tuple-like (indexable)
42
+ 0: 3,
43
+ 1: 11,
44
+ 2: 0,
45
+ 3: "final",
46
+ 4: 0,
47
+ length: 5,
48
+ [Symbol.iterator]: function* () {
49
+ yield this.major;
50
+ yield this.minor;
51
+ yield this.micro;
52
+ yield this.releaselevel;
53
+ yield this.serial;
54
+ }
55
+ };
56
+ var executable = typeof process !== "undefined" ? process.execPath : "";
57
+ var path = (() => {
58
+ if (typeof process === "undefined") return [];
59
+ return [];
60
+ })();
61
+ var maxsize = Number.MAX_SAFE_INTEGER;
62
+ var stdin = typeof process !== "undefined" ? process.stdin : null;
63
+ var stdout = typeof process !== "undefined" ? process.stdout : null;
64
+ var stderr = typeof process !== "undefined" ? process.stderr : null;
65
+ function exit(code) {
66
+ if (typeof process !== "undefined") {
67
+ process.exit(code ?? 0);
68
+ }
69
+ throw new Error(`SystemExit: ${String(code ?? 0)}`);
70
+ }
71
+ function getRecursionLimit() {
72
+ return 1e3;
73
+ }
74
+ function setRecursionLimit(limit) {
75
+ void limit;
76
+ }
77
+ function getSizeOf(obj) {
78
+ const seen = /* @__PURE__ */ new WeakSet();
79
+ function estimate(value) {
80
+ if (value === null || value === void 0) return 0;
81
+ const type = typeof value;
82
+ if (type === "boolean") return 4;
83
+ if (type === "number") return 8;
84
+ if (type === "string") return value.length * 2;
85
+ if (type === "bigint") return value.toString().length * 8 / 10;
86
+ if (type === "object" || type === "function") {
87
+ if (seen.has(value)) return 0;
88
+ seen.add(value);
89
+ if (Array.isArray(value)) {
90
+ return value.reduce((sum, item) => sum + estimate(item), 64);
91
+ }
92
+ if (value instanceof Map) {
93
+ let size2 = 64;
94
+ for (const [k, v] of value) {
95
+ size2 += estimate(k) + estimate(v);
96
+ }
97
+ return size2;
98
+ }
99
+ if (value instanceof Set) {
100
+ let size2 = 64;
101
+ for (const item of value) {
102
+ size2 += estimate(item);
103
+ }
104
+ return size2;
105
+ }
106
+ let size = 64;
107
+ for (const key in value) {
108
+ size += key.length * 2 + estimate(value[key]);
109
+ }
110
+ return size;
111
+ }
112
+ return 0;
113
+ }
114
+ return estimate(obj);
115
+ }
116
+ function getRefCount(obj) {
117
+ void obj;
118
+ return 1;
119
+ }
120
+ function getDefaultEncoding() {
121
+ return "utf-8";
122
+ }
123
+ function getFilesystemEncoding() {
124
+ return "utf-8";
125
+ }
126
+ var apiVersion = 0;
127
+ var prefix = typeof process !== "undefined" ? process.execPath.replace(/\/bin\/node$/, "") : "";
128
+ var byteorder = (() => {
129
+ const buffer = new ArrayBuffer(2);
130
+ new DataView(buffer).setInt16(0, 256, true);
131
+ return new Int16Array(buffer)[0] === 256 ? "little" : "big";
132
+ })();
133
+ var floatInfo = {
134
+ max: Number.MAX_VALUE,
135
+ maxExp: 1024,
136
+ max10Exp: 308,
137
+ min: Number.MIN_VALUE,
138
+ minExp: -1021,
139
+ min10Exp: -307,
140
+ dig: 15,
141
+ mant_dig: 53,
142
+ epsilon: Number.EPSILON,
143
+ radix: 2,
144
+ rounds: 1
145
+ };
146
+ var intInfo = {
147
+ bitsPerDigit: 30,
148
+ sizeofDigit: 4,
149
+ defaultMaxStrDigits: 4300,
150
+ strDigitsCheckThreshold: 640
151
+ };
152
+ var hashInfo = {
153
+ width: 64,
154
+ modulus: 2n ** 61n - 1n,
155
+ inf: 314159,
156
+ nan: 0,
157
+ imag: 1000003,
158
+ algorithm: "siphash24",
159
+ hashBits: 64,
160
+ seedBits: 128
161
+ };
162
+
163
+ export {
164
+ argv,
165
+ platform,
166
+ version,
167
+ versionInfo,
168
+ executable,
169
+ path,
170
+ maxsize,
171
+ stdin,
172
+ stdout,
173
+ stderr,
174
+ exit,
175
+ getRecursionLimit,
176
+ setRecursionLimit,
177
+ getSizeOf,
178
+ getRefCount,
179
+ getDefaultEncoding,
180
+ getFilesystemEncoding,
181
+ apiVersion,
182
+ prefix,
183
+ byteorder,
184
+ floatInfo,
185
+ intInfo,
186
+ hashInfo,
187
+ sys_exports
188
+ };
189
+ /* v8 ignore next -- browser fallback @preserve */
190
+ /* v8 ignore next 5 -- always returns empty array @preserve */
191
+ /* v8 ignore next 2 -- browser fallback @preserve */
192
+ /* v8 ignore next 3 -- always runs in Node.js @preserve */
193
+ /* v8 ignore start -- Set branch tested via getSizeOf(new Set()) @preserve */
194
+ /* v8 ignore next -- unreachable after typeof checks @preserve */
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./chunk-PZ5AY32C.js";
3
+ } from "./chunk-MLKGABMK.js";
4
4
 
5
5
  // src/math.ts
6
6
  var math_exports = {};
@@ -258,4 +258,3 @@ export {
258
258
  prod,
259
259
  math_exports
260
260
  };
261
- //# sourceMappingURL=chunk-56DGFWIJ.js.map
@@ -0,0 +1,141 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-MLKGABMK.js";
4
+
5
+ // src/glob.node.ts
6
+ var glob_node_exports = {};
7
+ __export(glob_node_exports, {
8
+ escape: () => escape,
9
+ glob: () => glob,
10
+ hasMagic: () => hasMagic,
11
+ iglob: () => iglob,
12
+ rglob: () => rglob
13
+ });
14
+ import { readdir, stat } from "fs/promises";
15
+ import { isAbsolute, join, relative } from "path";
16
+ async function glob(pattern, options) {
17
+ const rootDir = options?.rootDir ?? ".";
18
+ const recursive = options?.recursive ?? pattern.includes("**");
19
+ const includeHidden = options?.includeHidden ?? false;
20
+ const results = [];
21
+ const regex = patternToRegex(pattern);
22
+ const isAbsolutePath = isAbsolute(pattern);
23
+ const baseDir = isAbsolutePath ? "/" : rootDir;
24
+ const parts = pattern.split(/[\\/]/);
25
+ let fixedPrefix = "";
26
+ for (let i = 0; i < parts.length; i++) {
27
+ const part = parts[i] ?? "";
28
+ if (part.includes("*") || part.includes("?") || part.includes("[")) {
29
+ break;
30
+ }
31
+ if (fixedPrefix) {
32
+ fixedPrefix = join(fixedPrefix, part);
33
+ } else if (part === "" && i === 0 && isAbsolutePath) {
34
+ fixedPrefix = "/";
35
+ } else {
36
+ fixedPrefix = part;
37
+ }
38
+ }
39
+ const searchDir = fixedPrefix ? isAbsolutePath ? fixedPrefix : join(rootDir, fixedPrefix) : baseDir;
40
+ const walk = async (dir, depth) => {
41
+ let entries;
42
+ try {
43
+ entries = await readdir(dir);
44
+ } catch {
45
+ return;
46
+ }
47
+ for (const entry of entries) {
48
+ if (!includeHidden && entry.startsWith(".")) {
49
+ continue;
50
+ }
51
+ const fullPath = join(dir, entry);
52
+ const relativePath = isAbsolutePath ? fullPath : relative(rootDir, fullPath);
53
+ if (regex.test(relativePath)) {
54
+ results.push(relativePath);
55
+ }
56
+ if (recursive) {
57
+ try {
58
+ if ((await stat(fullPath)).isDirectory()) {
59
+ await walk(fullPath, depth + 1);
60
+ }
61
+ } catch {
62
+ }
63
+ }
64
+ }
65
+ };
66
+ await walk(searchDir, 0);
67
+ return results.sort();
68
+ }
69
+ async function* iglob(pattern, options) {
70
+ const results = await glob(pattern, options);
71
+ for (const result of results) {
72
+ yield result;
73
+ }
74
+ }
75
+ function escape(pathname) {
76
+ return pathname.replace(/([*?[])/g, "[$1]");
77
+ }
78
+ function hasMagic(pattern) {
79
+ return /[*?[\]]/.test(pattern);
80
+ }
81
+ function patternToRegex(pattern) {
82
+ let regex = "";
83
+ let i = 0;
84
+ while (i < pattern.length) {
85
+ const char = pattern[i];
86
+ if (char === "*") {
87
+ if (pattern[i + 1] === "*") {
88
+ if (pattern[i + 2] === "/" || pattern[i + 2] === "\\") {
89
+ regex += "(?:.*/)?";
90
+ i += 3;
91
+ } else {
92
+ regex += ".*";
93
+ i += 2;
94
+ }
95
+ } else {
96
+ regex += "[^/\\\\]*";
97
+ i++;
98
+ }
99
+ } else if (char === "?") {
100
+ regex += "[^/\\\\]";
101
+ i++;
102
+ } else if (char === "[") {
103
+ let j = i + 1;
104
+ let charClass = "[";
105
+ if (pattern[j] === "!" || pattern[j] === "^") {
106
+ charClass += "^";
107
+ j++;
108
+ }
109
+ while (j < pattern.length && pattern[j] !== "]") {
110
+ charClass += pattern[j] ?? "";
111
+ j++;
112
+ }
113
+ charClass += "]";
114
+ regex += charClass;
115
+ i = j + 1;
116
+ } else if (char === "/" || char === "\\") {
117
+ regex += "[/\\\\]";
118
+ i++;
119
+ } else if (".+^${}()|\\".includes(char ?? "")) {
120
+ regex += "\\" + (char ?? "");
121
+ i++;
122
+ } else {
123
+ regex += char ?? "";
124
+ i++;
125
+ }
126
+ }
127
+ return new RegExp("^" + regex + "$");
128
+ }
129
+ async function rglob(pattern, rootDir = ".") {
130
+ const fullPattern = pattern.startsWith("**") ? pattern : "**/" + pattern;
131
+ return glob(fullPattern, { recursive: true, rootDir });
132
+ }
133
+
134
+ export {
135
+ glob,
136
+ iglob,
137
+ escape,
138
+ hasMagic,
139
+ rglob,
140
+ glob_node_exports
141
+ };