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.
- package/README.md +123 -49
- package/dist/base64-C_am75Sv.d.ts +165 -0
- package/dist/base64.d.ts +1 -0
- package/dist/base64.js +37 -0
- package/dist/chunk-2QEMKE7U.js +252 -0
- package/dist/chunk-2YTO24B5.js +78 -0
- package/dist/chunk-3HQSBCEC.js +348 -0
- package/dist/{chunk-7BZB2TQF.js → chunk-3M3PB4RO.js} +4 -6
- package/dist/chunk-5OKGPZBQ.js +1106 -0
- package/dist/chunk-B5LQJODJ.js +37 -0
- package/dist/{chunk-CUP6EPDB.js → chunk-BCMGGBWG.js} +2 -5
- package/dist/chunk-BCVIH2BN.js +175 -0
- package/dist/chunk-CANUXHVB.js +349 -0
- package/dist/{chunk-QURVRHY2.js → chunk-D35YI363.js} +15 -12
- package/dist/{chunk-RSBRI27Z.js → chunk-ETBW6XNR.js} +3 -4
- package/dist/chunk-HSTC277I.js +255 -0
- package/dist/chunk-HTCQ4OO5.js +238 -0
- package/dist/chunk-IANXD4D4.js +250 -0
- package/dist/{chunk-G6PUQTVZ.js → chunk-JAUU3HMH.js} +1 -2
- package/dist/chunk-JVTQM7CI.js +195 -0
- package/dist/chunk-KKJHGY4C.js +551 -0
- package/dist/chunk-LHPQS75Z.js +192 -0
- package/dist/{chunk-OSX7QZAW.js → chunk-LK2L2TFG.js} +5 -6
- package/dist/{chunk-CEZSBJJV.js → chunk-LWYBTWBZ.js} +2 -3
- package/dist/chunk-MEEU4SH5.js +362 -0
- package/dist/{chunk-TAYRRHJ3.js → chunk-MFKIEN7N.js} +1 -2
- package/dist/{chunk-PZ5AY32C.js → chunk-MLKGABMK.js} +0 -1
- package/dist/chunk-OZRS5PC4.js +312 -0
- package/dist/chunk-PVK4F3ME.js +194 -0
- package/dist/{chunk-56DGFWIJ.js → chunk-QKJBQKPY.js} +1 -2
- package/dist/chunk-RB6BYCIQ.js +141 -0
- package/dist/chunk-RRSOZXZE.js +155 -0
- package/dist/chunk-THMJVAK6.js +282 -0
- package/dist/chunk-UGZ5OY5Z.js +165 -0
- package/dist/chunk-WTZSAITC.js +82 -0
- package/dist/chunk-YONWJHJU.js +265 -0
- package/dist/collections.js +2 -3
- package/dist/copy-6ZaZ__ge.d.ts +59 -0
- package/dist/copy.d.ts +1 -0
- package/dist/copy.js +9 -0
- package/dist/datetime.js +2 -3
- package/dist/functools.js +2 -3
- package/dist/glob.browser-B6d_YdV5.d.ts +50 -0
- package/dist/glob.browser.d.ts +1 -0
- package/dist/glob.browser.js +15 -0
- package/dist/glob.node-wn5ehtyM.d.ts +80 -0
- package/dist/glob.node.d.ts +1 -0
- package/dist/glob.node.js +15 -0
- package/dist/hashlib-vKP511NY.d.ts +205 -0
- package/dist/hashlib.d.ts +1 -0
- package/dist/hashlib.js +39 -0
- package/dist/index.browser.d.ts +172 -0
- package/dist/index.browser.js +305 -0
- package/dist/index.d.ts +36 -602
- package/dist/index.js +138 -1073
- package/dist/itertools.js +2 -3
- package/dist/json.js +2 -3
- package/dist/logging.browser-Dux4L5kz.d.ts +185 -0
- package/dist/logging.browser.d.ts +1 -0
- package/dist/logging.browser.js +63 -0
- package/dist/logging.node-CH75bVdE.d.ts +185 -0
- package/dist/logging.node.d.ts +1 -0
- package/dist/logging.node.js +61 -0
- package/dist/math.js +2 -3
- package/dist/{os-CqGKe872.d.ts → os.browser-krjSx5kF.d.ts} +32 -55
- package/dist/os.browser.d.ts +2 -0
- package/dist/{os.js → os.browser.js} +41 -16
- package/dist/os.node-CQjch8Ht.d.ts +124 -0
- package/dist/os.node.d.ts +2 -0
- package/dist/os.node.js +83 -0
- package/dist/os.shared-C3x70nhO.d.ts +59 -0
- package/dist/pathlib.browser-NC7kKQYe.d.ts +91 -0
- package/dist/pathlib.browser.d.ts +1 -0
- package/dist/pathlib.browser.js +17 -0
- package/dist/pathlib.node-CY3yUFdT.d.ts +331 -0
- package/dist/pathlib.node.d.ts +2 -0
- package/dist/pathlib.node.js +17 -0
- package/dist/random.js +2 -3
- package/dist/re.js +2 -3
- package/dist/set-JQbLAq8B.d.ts +592 -0
- package/dist/shutil.browser-Ck5oWhnP.d.ts +113 -0
- package/dist/shutil.browser.d.ts +1 -0
- package/dist/shutil.browser.js +33 -0
- package/dist/shutil.node-C9kwvhAf.d.ts +160 -0
- package/dist/shutil.node.d.ts +2 -0
- package/dist/shutil.node.js +33 -0
- package/dist/string.js +2 -3
- package/dist/subprocess-CZVYzQ3V.d.ts +214 -0
- package/dist/subprocess.d.ts +1 -0
- package/dist/subprocess.js +29 -0
- package/dist/sys-IL8LgI_W.d.ts +212 -0
- package/dist/sys.d.ts +1 -0
- package/dist/sys.js +51 -0
- package/dist/tempfile.browser-DciOKfNm.d.ts +78 -0
- package/dist/tempfile.browser.d.ts +1 -0
- package/dist/tempfile.browser.js +19 -0
- package/dist/tempfile.node-bVMY60Cu.d.ts +195 -0
- package/dist/tempfile.node.d.ts +2 -0
- package/dist/tempfile.node.js +23 -0
- package/dist/time-CcYhdiSu.d.ts +245 -0
- package/dist/time.d.ts +1 -0
- package/dist/time.js +49 -0
- package/dist/urllib-DJtkj-0f.d.ts +198 -0
- package/dist/urllib.d.ts +1 -0
- package/dist/urllib.js +37 -0
- package/dist/uuid-C0ypmn56.d.ts +160 -0
- package/dist/uuid.d.ts +1 -0
- package/dist/uuid.js +23 -0
- package/package.json +128 -5
- package/dist/chunk-56DGFWIJ.js.map +0 -1
- package/dist/chunk-5AOJFFYN.js +0 -313
- package/dist/chunk-5AOJFFYN.js.map +0 -1
- package/dist/chunk-7BZB2TQF.js.map +0 -1
- package/dist/chunk-CEZSBJJV.js.map +0 -1
- package/dist/chunk-CUP6EPDB.js.map +0 -1
- package/dist/chunk-G6PUQTVZ.js.map +0 -1
- package/dist/chunk-OSX7QZAW.js.map +0 -1
- package/dist/chunk-PZ5AY32C.js.map +0 -1
- package/dist/chunk-QURVRHY2.js.map +0 -1
- package/dist/chunk-RSBRI27Z.js.map +0 -1
- package/dist/chunk-TAYRRHJ3.js.map +0 -1
- package/dist/collections.js.map +0 -1
- package/dist/datetime.js.map +0 -1
- package/dist/functools.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/itertools.js.map +0 -1
- package/dist/json.js.map +0 -1
- package/dist/math.js.map +0 -1
- package/dist/os.d.ts +0 -1
- package/dist/os.js.map +0 -1
- package/dist/random.js.map +0 -1
- package/dist/re.js.map +0 -1
- package/dist/string.js.map +0 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-MLKGABMK.js";
|
|
4
|
+
|
|
5
|
+
// src/glob.browser.ts
|
|
6
|
+
var glob_browser_exports = {};
|
|
7
|
+
__export(glob_browser_exports, {
|
|
8
|
+
escape: () => escape,
|
|
9
|
+
glob: () => glob,
|
|
10
|
+
hasMagic: () => hasMagic,
|
|
11
|
+
iglob: () => iglob,
|
|
12
|
+
rglob: () => rglob
|
|
13
|
+
});
|
|
14
|
+
async function glob(_pattern, _options) {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
async function* iglob(_pattern, _options) {
|
|
18
|
+
}
|
|
19
|
+
function escape(pathname) {
|
|
20
|
+
return pathname.replace(/([*?[])/g, "[$1]");
|
|
21
|
+
}
|
|
22
|
+
function hasMagic(pattern) {
|
|
23
|
+
return /[*?[\]]/.test(pattern);
|
|
24
|
+
}
|
|
25
|
+
async function rglob(_pattern, _rootDir = ".") {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
glob,
|
|
31
|
+
iglob,
|
|
32
|
+
escape,
|
|
33
|
+
hasMagic,
|
|
34
|
+
rglob,
|
|
35
|
+
glob_browser_exports
|
|
36
|
+
};
|
|
37
|
+
/* v8 ignore start -- browser stubs @preserve */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MLKGABMK.js";
|
|
4
4
|
|
|
5
5
|
// src/itertools.ts
|
|
6
6
|
var itertools_exports = {};
|
|
@@ -52,7 +52,7 @@ function combinations(iterable, r) {
|
|
|
52
52
|
function permutations(iterable, r) {
|
|
53
53
|
const pool = [...iterable];
|
|
54
54
|
const n = pool.length;
|
|
55
|
-
const rLen = r
|
|
55
|
+
const rLen = r ?? n;
|
|
56
56
|
if (rLen > n || rLen < 0) return [];
|
|
57
57
|
const result = [];
|
|
58
58
|
const indices = Array.from({ length: n }, (_, i) => i);
|
|
@@ -60,7 +60,6 @@ function permutations(iterable, r) {
|
|
|
60
60
|
result.push(indices.slice(0, rLen).map((i) => pool[i]));
|
|
61
61
|
outer: for (; ; ) {
|
|
62
62
|
for (let i = rLen - 1; i >= 0; i--) {
|
|
63
|
-
;
|
|
64
63
|
cycles[i]--;
|
|
65
64
|
if (cycles[i] === 0) {
|
|
66
65
|
const temp = indices[i];
|
|
@@ -92,7 +91,6 @@ function product(...iterables) {
|
|
|
92
91
|
for (; ; ) {
|
|
93
92
|
let i = pools.length - 1;
|
|
94
93
|
while (i >= 0) {
|
|
95
|
-
;
|
|
96
94
|
indices[i]++;
|
|
97
95
|
const currentPool = pools[i];
|
|
98
96
|
if (indices[i] < currentPool.length) {
|
|
@@ -361,4 +359,3 @@ export {
|
|
|
361
359
|
partition,
|
|
362
360
|
itertools_exports
|
|
363
361
|
};
|
|
364
|
-
//# sourceMappingURL=chunk-CUP6EPDB.js.map
|
|
@@ -0,0 +1,175 @@
|
|
|
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.browser.ts
|
|
33
|
+
var os_browser_exports = {};
|
|
34
|
+
__export(os_browser_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
|
+
var path = {
|
|
75
|
+
join: pathJoin,
|
|
76
|
+
basename: pathBasename,
|
|
77
|
+
dirname: pathDirname,
|
|
78
|
+
split: pathSplitFn,
|
|
79
|
+
splitExt: pathSplitExt,
|
|
80
|
+
extName: pathExtName,
|
|
81
|
+
isAbs: pathIsAbs,
|
|
82
|
+
normPath: pathNormPath,
|
|
83
|
+
relPath: pathRelPath,
|
|
84
|
+
commonPath: pathCommonPath,
|
|
85
|
+
expandUser: pathExpandUser,
|
|
86
|
+
expandVars: pathExpandVars,
|
|
87
|
+
/** Return normalized absolutized version of pathname */
|
|
88
|
+
absPath(p) {
|
|
89
|
+
if (pathIsAbs(p)) {
|
|
90
|
+
return pathNormPath(p);
|
|
91
|
+
}
|
|
92
|
+
return pathNormPath(p);
|
|
93
|
+
},
|
|
94
|
+
/** Return canonical path, eliminating symlinks (stub - just normalizes) */
|
|
95
|
+
realPath(p) {
|
|
96
|
+
return path.absPath(p);
|
|
97
|
+
},
|
|
98
|
+
/* v8 ignore start -- browser stubs @preserve */
|
|
99
|
+
/** Test if path exists (stub - always returns false in browser) */
|
|
100
|
+
exists(_p) {
|
|
101
|
+
return false;
|
|
102
|
+
},
|
|
103
|
+
/** Test if path is a file (stub - always returns false in browser) */
|
|
104
|
+
isFile(_p) {
|
|
105
|
+
return false;
|
|
106
|
+
},
|
|
107
|
+
/** Test if path is a directory (stub - always returns false in browser) */
|
|
108
|
+
isDir(_p) {
|
|
109
|
+
return false;
|
|
110
|
+
},
|
|
111
|
+
/** Test if path is a symbolic link (stub - always returns false in browser) */
|
|
112
|
+
isLink(_p) {
|
|
113
|
+
return false;
|
|
114
|
+
},
|
|
115
|
+
/** Return size of file (stub - returns 0 in browser) */
|
|
116
|
+
getSize(_p) {
|
|
117
|
+
return 0;
|
|
118
|
+
},
|
|
119
|
+
/** Return modification time (stub - returns 0 in browser) */
|
|
120
|
+
getMtime(_p) {
|
|
121
|
+
return 0;
|
|
122
|
+
},
|
|
123
|
+
/** Return access time (stub - returns 0 in browser) */
|
|
124
|
+
getAtime(_p) {
|
|
125
|
+
return 0;
|
|
126
|
+
},
|
|
127
|
+
/** Return creation time (stub - returns 0 in browser) */
|
|
128
|
+
getCtime(_p) {
|
|
129
|
+
return 0;
|
|
130
|
+
}
|
|
131
|
+
/* v8 ignore stop */
|
|
132
|
+
};
|
|
133
|
+
function listDir(_p = ".") {
|
|
134
|
+
return [];
|
|
135
|
+
}
|
|
136
|
+
function mkdir(_p, _mode = 511) {
|
|
137
|
+
}
|
|
138
|
+
function makeDirs(_p, _mode = 511, _existOk = false) {
|
|
139
|
+
}
|
|
140
|
+
function remove(_p) {
|
|
141
|
+
}
|
|
142
|
+
var unlink = remove;
|
|
143
|
+
function rmdir(_p) {
|
|
144
|
+
}
|
|
145
|
+
function removeDirs(_p) {
|
|
146
|
+
}
|
|
147
|
+
function rename(_src, _dst) {
|
|
148
|
+
}
|
|
149
|
+
function renames(_src, _dst) {
|
|
150
|
+
}
|
|
151
|
+
function replace(_src, _dst) {
|
|
152
|
+
}
|
|
153
|
+
function* walk(_top, _options) {
|
|
154
|
+
}
|
|
155
|
+
function stat(_p) {
|
|
156
|
+
return { st_mode: 0, st_size: 0, st_mtime: 0, st_atime: 0, st_ctime: 0 };
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export {
|
|
160
|
+
path,
|
|
161
|
+
listDir,
|
|
162
|
+
mkdir,
|
|
163
|
+
makeDirs,
|
|
164
|
+
remove,
|
|
165
|
+
unlink,
|
|
166
|
+
rmdir,
|
|
167
|
+
removeDirs,
|
|
168
|
+
rename,
|
|
169
|
+
renames,
|
|
170
|
+
replace,
|
|
171
|
+
walk,
|
|
172
|
+
stat,
|
|
173
|
+
os_browser_exports
|
|
174
|
+
};
|
|
175
|
+
/* v8 ignore start -- browser stubs for filesystem operations @preserve */
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-MLKGABMK.js";
|
|
4
|
+
|
|
5
|
+
// src/logging.browser.ts
|
|
6
|
+
var logging_browser_exports = {};
|
|
7
|
+
__export(logging_browser_exports, {
|
|
8
|
+
CRITICAL: () => CRITICAL,
|
|
9
|
+
DEBUG: () => DEBUG,
|
|
10
|
+
ERROR: () => ERROR,
|
|
11
|
+
FATAL: () => FATAL,
|
|
12
|
+
FileHandler: () => FileHandler,
|
|
13
|
+
Formatter: () => Formatter,
|
|
14
|
+
Handler: () => Handler,
|
|
15
|
+
INFO: () => INFO,
|
|
16
|
+
Logger: () => Logger,
|
|
17
|
+
NOTSET: () => NOTSET,
|
|
18
|
+
StreamHandler: () => StreamHandler,
|
|
19
|
+
WARN: () => WARN,
|
|
20
|
+
WARNING: () => WARNING,
|
|
21
|
+
basicConfig: () => basicConfig,
|
|
22
|
+
critical: () => critical,
|
|
23
|
+
debug: () => debug,
|
|
24
|
+
disable: () => disable,
|
|
25
|
+
error: () => error,
|
|
26
|
+
exception: () => exception,
|
|
27
|
+
fatal: () => fatal,
|
|
28
|
+
getLevelName: () => getLevelName,
|
|
29
|
+
getLogger: () => getLogger,
|
|
30
|
+
info: () => info,
|
|
31
|
+
levelNames: () => levelNames,
|
|
32
|
+
log: () => log,
|
|
33
|
+
setLevel: () => setLevel,
|
|
34
|
+
shutdown: () => shutdown,
|
|
35
|
+
warn: () => warn,
|
|
36
|
+
warning: () => warning
|
|
37
|
+
});
|
|
38
|
+
var CRITICAL = 50;
|
|
39
|
+
var FATAL = CRITICAL;
|
|
40
|
+
var ERROR = 40;
|
|
41
|
+
var WARNING = 30;
|
|
42
|
+
var WARN = WARNING;
|
|
43
|
+
var INFO = 20;
|
|
44
|
+
var DEBUG = 10;
|
|
45
|
+
var NOTSET = 0;
|
|
46
|
+
var levelNames = {
|
|
47
|
+
[CRITICAL]: "CRITICAL",
|
|
48
|
+
[ERROR]: "ERROR",
|
|
49
|
+
[WARNING]: "WARNING",
|
|
50
|
+
[INFO]: "INFO",
|
|
51
|
+
[DEBUG]: "DEBUG",
|
|
52
|
+
[NOTSET]: "NOTSET"
|
|
53
|
+
};
|
|
54
|
+
function getLevelName(level) {
|
|
55
|
+
if (typeof level === "number") {
|
|
56
|
+
return levelNames[level] ?? `Level ${String(level)}`;
|
|
57
|
+
}
|
|
58
|
+
const upper = level.toUpperCase();
|
|
59
|
+
for (const [num, name] of Object.entries(levelNames)) {
|
|
60
|
+
if (name === upper) {
|
|
61
|
+
return parseInt(num, 10);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return level;
|
|
65
|
+
}
|
|
66
|
+
var Handler = class {
|
|
67
|
+
level = NOTSET;
|
|
68
|
+
formatter = null;
|
|
69
|
+
setLevel(level) {
|
|
70
|
+
this.level = level;
|
|
71
|
+
}
|
|
72
|
+
setFormatter(formatter) {
|
|
73
|
+
this.formatter = formatter;
|
|
74
|
+
}
|
|
75
|
+
format(record) {
|
|
76
|
+
if (this.formatter) {
|
|
77
|
+
return this.formatter.format(record);
|
|
78
|
+
}
|
|
79
|
+
return record.msg;
|
|
80
|
+
}
|
|
81
|
+
handle(record) {
|
|
82
|
+
if (record.levelno >= this.level) {
|
|
83
|
+
this.emit(record);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
var StreamHandler = class extends Handler {
|
|
88
|
+
emit(record) {
|
|
89
|
+
const msg = this.format(record);
|
|
90
|
+
if (record.levelno >= ERROR) {
|
|
91
|
+
console.error(msg);
|
|
92
|
+
} else if (record.levelno >= WARNING) {
|
|
93
|
+
console.warn(msg);
|
|
94
|
+
} else if (record.levelno >= INFO) {
|
|
95
|
+
console.info(msg);
|
|
96
|
+
} else {
|
|
97
|
+
console.debug(msg);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
var FileHandler = class extends Handler {
|
|
102
|
+
filename;
|
|
103
|
+
mode;
|
|
104
|
+
constructor(filename, mode = "a") {
|
|
105
|
+
super();
|
|
106
|
+
this.filename = filename;
|
|
107
|
+
this.mode = mode;
|
|
108
|
+
}
|
|
109
|
+
emit(record) {
|
|
110
|
+
const msg = this.format(record);
|
|
111
|
+
console.log(`[${this.filename}]`, msg);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
var Formatter = class {
|
|
115
|
+
fmt;
|
|
116
|
+
datefmt;
|
|
117
|
+
constructor(fmt, datefmt) {
|
|
118
|
+
this.fmt = fmt ?? "%(levelname)s:%(name)s:%(message)s";
|
|
119
|
+
this.datefmt = datefmt ?? "%Y-%m-%d %H:%M:%S";
|
|
120
|
+
}
|
|
121
|
+
formatTime(record) {
|
|
122
|
+
const date = new Date(record.created * 1e3);
|
|
123
|
+
return this.datefmt.replace("%Y", String(date.getFullYear())).replace("%m", String(date.getMonth() + 1).padStart(2, "0")).replace("%d", String(date.getDate()).padStart(2, "0")).replace("%H", String(date.getHours()).padStart(2, "0")).replace("%M", String(date.getMinutes()).padStart(2, "0")).replace("%S", String(date.getSeconds()).padStart(2, "0"));
|
|
124
|
+
}
|
|
125
|
+
format(record) {
|
|
126
|
+
let msg = this.fmt.replace("%(name)s", record.name).replace("%(levelno)d", String(record.levelno)).replace("%(levelname)s", record.levelname).replace("%(message)s", record.msg).replace("%(asctime)s", this.formatTime(record));
|
|
127
|
+
if (record.filename) {
|
|
128
|
+
msg = msg.replace("%(filename)s", record.filename);
|
|
129
|
+
}
|
|
130
|
+
if (record.lineno !== void 0) {
|
|
131
|
+
msg = msg.replace("%(lineno)d", String(record.lineno));
|
|
132
|
+
}
|
|
133
|
+
if (record.funcName) {
|
|
134
|
+
msg = msg.replace("%(funcName)s", record.funcName);
|
|
135
|
+
}
|
|
136
|
+
return msg;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
var Logger = class {
|
|
140
|
+
name;
|
|
141
|
+
level = NOTSET;
|
|
142
|
+
handlers = [];
|
|
143
|
+
parent = null;
|
|
144
|
+
propagate = true;
|
|
145
|
+
constructor(name) {
|
|
146
|
+
this.name = name;
|
|
147
|
+
}
|
|
148
|
+
setLevel(level) {
|
|
149
|
+
this.level = level;
|
|
150
|
+
}
|
|
151
|
+
addHandler(handler) {
|
|
152
|
+
if (!this.handlers.includes(handler)) {
|
|
153
|
+
this.handlers.push(handler);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
removeHandler(handler) {
|
|
157
|
+
const index = this.handlers.indexOf(handler);
|
|
158
|
+
if (index !== -1) {
|
|
159
|
+
this.handlers.splice(index, 1);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
getEffectiveLevel() {
|
|
163
|
+
let logger = this;
|
|
164
|
+
while (logger) {
|
|
165
|
+
if (logger.level !== NOTSET) {
|
|
166
|
+
return logger.level;
|
|
167
|
+
}
|
|
168
|
+
logger = logger.parent;
|
|
169
|
+
}
|
|
170
|
+
return NOTSET;
|
|
171
|
+
}
|
|
172
|
+
isEnabledFor(level) {
|
|
173
|
+
return level >= this.getEffectiveLevel();
|
|
174
|
+
}
|
|
175
|
+
makeRecord(level, msg, args) {
|
|
176
|
+
let formattedMsg = msg;
|
|
177
|
+
if (args.length > 0) {
|
|
178
|
+
formattedMsg = msg.replace(/%[sdfo]/g, () => {
|
|
179
|
+
const arg = args.shift();
|
|
180
|
+
return String(arg);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
name: this.name,
|
|
185
|
+
levelno: level,
|
|
186
|
+
levelname: levelNames[level] ?? `Level ${String(level)}`,
|
|
187
|
+
msg: formattedMsg,
|
|
188
|
+
args,
|
|
189
|
+
created: Date.now() / 1e3
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
handle(record) {
|
|
193
|
+
for (const handler of this.handlers) {
|
|
194
|
+
handler.handle(record);
|
|
195
|
+
}
|
|
196
|
+
if (this.propagate && this.parent) {
|
|
197
|
+
this.parent.handle(record);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
log(level, msg, ...args) {
|
|
201
|
+
if (this.isEnabledFor(level)) {
|
|
202
|
+
const record = this.makeRecord(level, msg, args);
|
|
203
|
+
this.handle(record);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
debug(msg, ...args) {
|
|
207
|
+
this.log(DEBUG, msg, ...args);
|
|
208
|
+
}
|
|
209
|
+
info(msg, ...args) {
|
|
210
|
+
this.log(INFO, msg, ...args);
|
|
211
|
+
}
|
|
212
|
+
warning(msg, ...args) {
|
|
213
|
+
this.log(WARNING, msg, ...args);
|
|
214
|
+
}
|
|
215
|
+
warn(msg, ...args) {
|
|
216
|
+
this.warning(msg, ...args);
|
|
217
|
+
}
|
|
218
|
+
error(msg, ...args) {
|
|
219
|
+
this.log(ERROR, msg, ...args);
|
|
220
|
+
}
|
|
221
|
+
critical(msg, ...args) {
|
|
222
|
+
this.log(CRITICAL, msg, ...args);
|
|
223
|
+
}
|
|
224
|
+
fatal(msg, ...args) {
|
|
225
|
+
this.critical(msg, ...args);
|
|
226
|
+
}
|
|
227
|
+
exception(msg, ...args) {
|
|
228
|
+
this.error(msg, ...args);
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
var loggers = /* @__PURE__ */ new Map();
|
|
232
|
+
var rootLogger = new Logger("root");
|
|
233
|
+
rootLogger.setLevel(WARNING);
|
|
234
|
+
function getLogger(name) {
|
|
235
|
+
if (!name) {
|
|
236
|
+
return rootLogger;
|
|
237
|
+
}
|
|
238
|
+
let logger = loggers.get(name);
|
|
239
|
+
if (!logger) {
|
|
240
|
+
logger = new Logger(name);
|
|
241
|
+
const parts = name.split(".");
|
|
242
|
+
if (parts.length > 1) {
|
|
243
|
+
const parentName = parts.slice(0, -1).join(".");
|
|
244
|
+
logger.parent = getLogger(parentName);
|
|
245
|
+
} else {
|
|
246
|
+
logger.parent = rootLogger;
|
|
247
|
+
}
|
|
248
|
+
loggers.set(name, logger);
|
|
249
|
+
}
|
|
250
|
+
return logger;
|
|
251
|
+
}
|
|
252
|
+
function basicConfig(options) {
|
|
253
|
+
if (rootLogger.handlers.length > 0 && !options?.handlers) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
rootLogger.handlers = [];
|
|
257
|
+
if (options?.level !== void 0) {
|
|
258
|
+
rootLogger.setLevel(options.level);
|
|
259
|
+
}
|
|
260
|
+
const formatter = new Formatter(options?.format, options?.datefmt);
|
|
261
|
+
if (options?.handlers) {
|
|
262
|
+
for (const handler of options.handlers) {
|
|
263
|
+
handler.setFormatter(formatter);
|
|
264
|
+
rootLogger.addHandler(handler);
|
|
265
|
+
}
|
|
266
|
+
} else if (options?.filename) {
|
|
267
|
+
const handler = new FileHandler(options.filename, options.filemode);
|
|
268
|
+
handler.setFormatter(formatter);
|
|
269
|
+
rootLogger.addHandler(handler);
|
|
270
|
+
} else {
|
|
271
|
+
const handler = new StreamHandler();
|
|
272
|
+
handler.setFormatter(formatter);
|
|
273
|
+
rootLogger.addHandler(handler);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function debug(msg, ...args) {
|
|
277
|
+
rootLogger.debug(msg, ...args);
|
|
278
|
+
}
|
|
279
|
+
function info(msg, ...args) {
|
|
280
|
+
rootLogger.info(msg, ...args);
|
|
281
|
+
}
|
|
282
|
+
function warning(msg, ...args) {
|
|
283
|
+
rootLogger.warning(msg, ...args);
|
|
284
|
+
}
|
|
285
|
+
function warn(msg, ...args) {
|
|
286
|
+
rootLogger.warn(msg, ...args);
|
|
287
|
+
}
|
|
288
|
+
function error(msg, ...args) {
|
|
289
|
+
rootLogger.error(msg, ...args);
|
|
290
|
+
}
|
|
291
|
+
function critical(msg, ...args) {
|
|
292
|
+
rootLogger.critical(msg, ...args);
|
|
293
|
+
}
|
|
294
|
+
function fatal(msg, ...args) {
|
|
295
|
+
rootLogger.fatal(msg, ...args);
|
|
296
|
+
}
|
|
297
|
+
function exception(msg, ...args) {
|
|
298
|
+
rootLogger.exception(msg, ...args);
|
|
299
|
+
}
|
|
300
|
+
function log(level, msg, ...args) {
|
|
301
|
+
rootLogger.log(level, msg, ...args);
|
|
302
|
+
}
|
|
303
|
+
function setLevel(level) {
|
|
304
|
+
rootLogger.setLevel(level);
|
|
305
|
+
}
|
|
306
|
+
function disable(level = CRITICAL) {
|
|
307
|
+
rootLogger.setLevel(level + 1);
|
|
308
|
+
}
|
|
309
|
+
function shutdown() {
|
|
310
|
+
rootLogger.handlers = [];
|
|
311
|
+
for (const logger of loggers.values()) {
|
|
312
|
+
logger.handlers = [];
|
|
313
|
+
}
|
|
314
|
+
loggers.clear();
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export {
|
|
318
|
+
CRITICAL,
|
|
319
|
+
FATAL,
|
|
320
|
+
ERROR,
|
|
321
|
+
WARNING,
|
|
322
|
+
WARN,
|
|
323
|
+
INFO,
|
|
324
|
+
DEBUG,
|
|
325
|
+
NOTSET,
|
|
326
|
+
levelNames,
|
|
327
|
+
getLevelName,
|
|
328
|
+
Handler,
|
|
329
|
+
StreamHandler,
|
|
330
|
+
FileHandler,
|
|
331
|
+
Formatter,
|
|
332
|
+
Logger,
|
|
333
|
+
getLogger,
|
|
334
|
+
basicConfig,
|
|
335
|
+
debug,
|
|
336
|
+
info,
|
|
337
|
+
warning,
|
|
338
|
+
warn,
|
|
339
|
+
error,
|
|
340
|
+
critical,
|
|
341
|
+
fatal,
|
|
342
|
+
exception,
|
|
343
|
+
log,
|
|
344
|
+
setLevel,
|
|
345
|
+
disable,
|
|
346
|
+
shutdown,
|
|
347
|
+
logging_browser_exports
|
|
348
|
+
};
|
|
349
|
+
/* v8 ignore start -- browser version tested via browser tests @preserve */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MLKGABMK.js";
|
|
4
4
|
|
|
5
5
|
// src/functools.ts
|
|
6
6
|
var functools_exports = {};
|
|
@@ -54,14 +54,15 @@ function lruCache(func, maxsize = 128) {
|
|
|
54
54
|
let misses = 0;
|
|
55
55
|
const cached = ((...args) => {
|
|
56
56
|
const key = JSON.stringify(args);
|
|
57
|
-
|
|
57
|
+
const entry = cache2.get(key);
|
|
58
|
+
if (entry !== void 0) {
|
|
58
59
|
hits++;
|
|
59
60
|
const idx = order.indexOf(key);
|
|
60
61
|
if (idx > -1) {
|
|
61
62
|
order.splice(idx, 1);
|
|
62
63
|
order.push(key);
|
|
63
64
|
}
|
|
64
|
-
return
|
|
65
|
+
return entry.value;
|
|
65
66
|
}
|
|
66
67
|
misses++;
|
|
67
68
|
const result = func(...args);
|
|
@@ -71,7 +72,7 @@ function lruCache(func, maxsize = 128) {
|
|
|
71
72
|
cache2.delete(oldest);
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
|
-
cache2.set(key, result);
|
|
75
|
+
cache2.set(key, { value: result });
|
|
75
76
|
order.push(key);
|
|
76
77
|
return result;
|
|
77
78
|
});
|
|
@@ -93,11 +94,12 @@ function cache(func) {
|
|
|
93
94
|
const cacheMap = /* @__PURE__ */ new Map();
|
|
94
95
|
return ((...args) => {
|
|
95
96
|
const key = JSON.stringify(args);
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
const entry = cacheMap.get(key);
|
|
98
|
+
if (entry !== void 0) {
|
|
99
|
+
return entry.value;
|
|
98
100
|
}
|
|
99
101
|
const result = func(...args);
|
|
100
|
-
cacheMap.set(key, result);
|
|
102
|
+
cacheMap.set(key, { value: result });
|
|
101
103
|
return result;
|
|
102
104
|
});
|
|
103
105
|
}
|
|
@@ -135,8 +137,9 @@ function wraps(wrapped) {
|
|
|
135
137
|
};
|
|
136
138
|
}
|
|
137
139
|
function attrGetter(...attrs) {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
+
const [firstAttr] = attrs;
|
|
141
|
+
if (attrs.length === 1 && firstAttr !== void 0) {
|
|
142
|
+
const attr = firstAttr;
|
|
140
143
|
const parts = attr.split(".");
|
|
141
144
|
return (obj) => {
|
|
142
145
|
let result = obj;
|
|
@@ -158,8 +161,9 @@ function attrGetter(...attrs) {
|
|
|
158
161
|
};
|
|
159
162
|
}
|
|
160
163
|
function itemGetter(...items) {
|
|
161
|
-
|
|
162
|
-
|
|
164
|
+
const [firstItem] = items;
|
|
165
|
+
if (items.length === 1 && firstItem !== void 0) {
|
|
166
|
+
const item = firstItem;
|
|
163
167
|
return (obj) => {
|
|
164
168
|
if (Array.isArray(obj) && typeof item === "number") {
|
|
165
169
|
return obj[item];
|
|
@@ -248,4 +252,3 @@ export {
|
|
|
248
252
|
functools_exports
|
|
249
253
|
};
|
|
250
254
|
/* v8 ignore start -- complex utility rarely used directly @preserve */
|
|
251
|
-
//# sourceMappingURL=chunk-QURVRHY2.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MLKGABMK.js";
|
|
4
4
|
|
|
5
5
|
// src/re.ts
|
|
6
6
|
var re_exports = {};
|
|
@@ -144,8 +144,8 @@ var Match = class {
|
|
|
144
144
|
}
|
|
145
145
|
/** Return iterator of all groups */
|
|
146
146
|
*[Symbol.iterator]() {
|
|
147
|
-
for (
|
|
148
|
-
yield
|
|
147
|
+
for (const match2 of this._match) {
|
|
148
|
+
yield match2;
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
toString() {
|
|
@@ -420,4 +420,3 @@ export {
|
|
|
420
420
|
purge,
|
|
421
421
|
re_exports
|
|
422
422
|
};
|
|
423
|
-
//# sourceMappingURL=chunk-RSBRI27Z.js.map
|