pythonlib 1.0.1 → 2.0.0
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 +3 -1
- 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-2YTO24B5.js +78 -0
- package/dist/chunk-3CLXPGAB.js +237 -0
- package/dist/{chunk-H76SKASU.js → chunk-3M3PB4RO.js} +4 -6
- package/dist/chunk-5OKGPZBQ.js +1106 -0
- package/dist/chunk-5VAHUJNC.js +348 -0
- package/dist/chunk-B5AUEOAH.js +193 -0
- package/dist/chunk-B5LQJODJ.js +37 -0
- package/dist/{chunk-HQ42WNKZ.js → chunk-BCMGGBWG.js} +2 -5
- package/dist/chunk-BCVIH2BN.js +175 -0
- package/dist/{chunk-EE7SK2GV.js → chunk-D35YI363.js} +15 -12
- package/dist/{chunk-7TH4FCVQ.js → chunk-ETBW6XNR.js} +3 -4
- package/dist/chunk-FCJ7E4OE.js +250 -0
- package/dist/chunk-HSTC277I.js +255 -0
- package/dist/chunk-IANXD4D4.js +250 -0
- package/dist/{chunk-4KYJT3DR.js → chunk-JAUU3HMH.js} +1 -2
- package/dist/chunk-JJKTRIVO.js +262 -0
- package/dist/chunk-KKHKTQNN.js +361 -0
- package/dist/chunk-KKJHGY4C.js +551 -0
- package/dist/chunk-LHPQS75Z.js +192 -0
- package/dist/{chunk-LWO6BIAD.js → chunk-LK2L2TFG.js} +5 -6
- package/dist/chunk-LLZFLQS6.js +280 -0
- package/dist/chunk-LTXTS7RP.js +154 -0
- package/dist/{chunk-4QG3772L.js → chunk-LWYBTWBZ.js} +2 -3
- package/dist/{chunk-6ZAJ37MR.js → chunk-MFKIEN7N.js} +3 -3
- package/dist/{chunk-PZ5AY32C.js → chunk-MLKGABMK.js} +0 -1
- package/dist/chunk-OZRS5PC4.js +312 -0
- package/dist/chunk-PWA3YQZU.js +346 -0
- package/dist/{chunk-6POEDI34.js → chunk-QKJBQKPY.js} +1 -2
- package/dist/chunk-RB6BYCIQ.js +141 -0
- package/dist/chunk-U4X5DEIP.js +188 -0
- package/dist/chunk-UGZ5OY5Z.js +165 -0
- package/dist/chunk-WTZSAITC.js +82 -0
- package/dist/{collections-CJur5Wg-.d.ts → collections-BthXtkEp.d.ts} +5 -1
- package/dist/collections.d.ts +1 -1
- 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-Bpce8gG2.d.ts → datetime-BM_IjhTq.d.ts} +3 -1
- package/dist/datetime.d.ts +1 -1
- package/dist/datetime.js +2 -3
- package/dist/{functools-NrsZAqJk.d.ts → functools-uIa5g75p.d.ts} +3 -1
- package/dist/functools.d.ts +1 -1
- 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 +304 -0
- package/dist/index.d.ts +61 -437
- package/dist/index.js +138 -1115
- package/dist/{itertools-Sjl1LB_0.d.ts → itertools-T0rwOk2j.d.ts} +2 -4
- package/dist/itertools.d.ts +1 -1
- package/dist/itertools.js +2 -3
- package/dist/{json-DAlvCadU.d.ts → json-DoWhX04T.d.ts} +1 -0
- package/dist/json.d.ts +1 -1
- 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-DwEGjjQ-.d.ts → math-D2NPMc-x.d.ts} +2 -1
- package/dist/math.d.ts +1 -1
- package/dist/math.js +2 -3
- package/dist/{os-C6Nt7Ijx.d.ts → os.browser-krjSx5kF.d.ts} +32 -54
- 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-BJv_rSpL.d.ts → random-DcS5jtEs.d.ts} +3 -5
- package/dist/random.d.ts +1 -1
- package/dist/random.js +2 -3
- package/dist/{re-B1CHCgyr.d.ts → re-Bo-IOqov.d.ts} +3 -7
- package/dist/re.d.ts +1 -1
- 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.d.ts +3 -1
- 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 +127 -5
- package/dist/chunk-4KYJT3DR.js.map +0 -1
- package/dist/chunk-4QG3772L.js.map +0 -1
- package/dist/chunk-6POEDI34.js.map +0 -1
- package/dist/chunk-6ZAJ37MR.js.map +0 -1
- package/dist/chunk-7TH4FCVQ.js.map +0 -1
- package/dist/chunk-CXKGPD5D.js +0 -313
- package/dist/chunk-CXKGPD5D.js.map +0 -1
- package/dist/chunk-EE7SK2GV.js.map +0 -1
- package/dist/chunk-H76SKASU.js.map +0 -1
- package/dist/chunk-HQ42WNKZ.js.map +0 -1
- package/dist/chunk-LWO6BIAD.js.map +0 -1
- package/dist/chunk-PZ5AY32C.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,255 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-MLKGABMK.js";
|
|
4
|
+
|
|
5
|
+
// src/pathlib.browser.ts
|
|
6
|
+
var pathlib_browser_exports = {};
|
|
7
|
+
__export(pathlib_browser_exports, {
|
|
8
|
+
Path: () => Path,
|
|
9
|
+
PosixPath: () => PosixPath,
|
|
10
|
+
PurePath: () => PurePath,
|
|
11
|
+
PurePosixPath: () => PurePosixPath,
|
|
12
|
+
PureWindowsPath: () => PureWindowsPath,
|
|
13
|
+
WindowsPath: () => WindowsPath
|
|
14
|
+
});
|
|
15
|
+
var SEP = "/";
|
|
16
|
+
function basename(p) {
|
|
17
|
+
const normalized = p.replace(/\/+$/, "");
|
|
18
|
+
const idx = normalized.lastIndexOf(SEP);
|
|
19
|
+
return idx === -1 ? normalized : normalized.slice(idx + 1);
|
|
20
|
+
}
|
|
21
|
+
function dirname(p) {
|
|
22
|
+
const normalized = p.replace(/\/+$/, "");
|
|
23
|
+
const idx = normalized.lastIndexOf(SEP);
|
|
24
|
+
if (idx === -1) return "";
|
|
25
|
+
if (idx === 0) return SEP;
|
|
26
|
+
return normalized.slice(0, idx);
|
|
27
|
+
}
|
|
28
|
+
function extname(p) {
|
|
29
|
+
const base = basename(p);
|
|
30
|
+
const dotIdx = base.lastIndexOf(".");
|
|
31
|
+
if (dotIdx <= 0) return "";
|
|
32
|
+
return base.slice(dotIdx);
|
|
33
|
+
}
|
|
34
|
+
function join(...parts) {
|
|
35
|
+
return parts.filter(Boolean).join(SEP).replace(/\/+/g, "/");
|
|
36
|
+
}
|
|
37
|
+
function isAbsolute(p) {
|
|
38
|
+
return p.startsWith(SEP);
|
|
39
|
+
}
|
|
40
|
+
function normalize(p) {
|
|
41
|
+
if (!p) return ".";
|
|
42
|
+
const isAbs = isAbsolute(p);
|
|
43
|
+
const parts = p.split(SEP).filter(Boolean);
|
|
44
|
+
const result = [];
|
|
45
|
+
for (const part of parts) {
|
|
46
|
+
if (part === "..") {
|
|
47
|
+
if (result.length > 0 && result[result.length - 1] !== "..") {
|
|
48
|
+
result.pop();
|
|
49
|
+
} else if (!isAbs) {
|
|
50
|
+
result.push("..");
|
|
51
|
+
}
|
|
52
|
+
} else if (part !== ".") {
|
|
53
|
+
result.push(part);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const normalized = result.join(SEP);
|
|
57
|
+
if (isAbs) return SEP + normalized;
|
|
58
|
+
return normalized || ".";
|
|
59
|
+
}
|
|
60
|
+
var Path = class _Path {
|
|
61
|
+
_path;
|
|
62
|
+
constructor(...pathSegments) {
|
|
63
|
+
if (pathSegments.length === 0) {
|
|
64
|
+
this._path = ".";
|
|
65
|
+
} else {
|
|
66
|
+
this._path = join(...pathSegments);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
static of(...pathSegments) {
|
|
70
|
+
return new _Path(...pathSegments);
|
|
71
|
+
}
|
|
72
|
+
get name() {
|
|
73
|
+
return basename(this._path);
|
|
74
|
+
}
|
|
75
|
+
get stem() {
|
|
76
|
+
const base = basename(this._path);
|
|
77
|
+
const ext = extname(base);
|
|
78
|
+
return ext ? base.slice(0, -ext.length) : base;
|
|
79
|
+
}
|
|
80
|
+
get suffix() {
|
|
81
|
+
return extname(this._path);
|
|
82
|
+
}
|
|
83
|
+
get suffixes() {
|
|
84
|
+
const name = this.name;
|
|
85
|
+
const suffixes = [];
|
|
86
|
+
let remaining = name;
|
|
87
|
+
let ext = extname(remaining);
|
|
88
|
+
while (ext) {
|
|
89
|
+
suffixes.unshift(ext);
|
|
90
|
+
remaining = remaining.slice(0, -ext.length);
|
|
91
|
+
ext = extname(remaining);
|
|
92
|
+
}
|
|
93
|
+
return suffixes;
|
|
94
|
+
}
|
|
95
|
+
get parent() {
|
|
96
|
+
const parentPath = dirname(this._path);
|
|
97
|
+
return new _Path(parentPath || ".");
|
|
98
|
+
}
|
|
99
|
+
get parents() {
|
|
100
|
+
const parents = [];
|
|
101
|
+
let current = this.parent;
|
|
102
|
+
while (current._path !== "." && current._path !== SEP) {
|
|
103
|
+
parents.push(current);
|
|
104
|
+
current = current.parent;
|
|
105
|
+
}
|
|
106
|
+
if (current._path === SEP) {
|
|
107
|
+
parents.push(current);
|
|
108
|
+
}
|
|
109
|
+
return parents;
|
|
110
|
+
}
|
|
111
|
+
get parts() {
|
|
112
|
+
const parts = [];
|
|
113
|
+
if (this._path.startsWith(SEP)) {
|
|
114
|
+
parts.push(SEP);
|
|
115
|
+
}
|
|
116
|
+
parts.push(...this._path.split(SEP).filter(Boolean));
|
|
117
|
+
return parts;
|
|
118
|
+
}
|
|
119
|
+
get anchor() {
|
|
120
|
+
return this._path.startsWith(SEP) ? SEP : "";
|
|
121
|
+
}
|
|
122
|
+
get root() {
|
|
123
|
+
return this.anchor;
|
|
124
|
+
}
|
|
125
|
+
isAbsolute() {
|
|
126
|
+
return isAbsolute(this._path);
|
|
127
|
+
}
|
|
128
|
+
isRelativeTo(other) {
|
|
129
|
+
const otherPath = other instanceof _Path ? other._path : other;
|
|
130
|
+
const normalizedThis = normalize(this._path);
|
|
131
|
+
const normalizedOther = normalize(otherPath);
|
|
132
|
+
return normalizedThis.startsWith(normalizedOther + SEP) || normalizedThis === normalizedOther;
|
|
133
|
+
}
|
|
134
|
+
joinpath(...pathSegments) {
|
|
135
|
+
const segments = pathSegments.map((p) => p instanceof _Path ? p._path : p);
|
|
136
|
+
return new _Path(this._path, ...segments);
|
|
137
|
+
}
|
|
138
|
+
div(other) {
|
|
139
|
+
return this.joinpath(other);
|
|
140
|
+
}
|
|
141
|
+
withName(name) {
|
|
142
|
+
return new _Path(dirname(this._path), name);
|
|
143
|
+
}
|
|
144
|
+
withStem(stem) {
|
|
145
|
+
return new _Path(dirname(this._path), stem + this.suffix);
|
|
146
|
+
}
|
|
147
|
+
withSuffix(suffix) {
|
|
148
|
+
return new _Path(dirname(this._path), this.stem + suffix);
|
|
149
|
+
}
|
|
150
|
+
toString() {
|
|
151
|
+
return this._path;
|
|
152
|
+
}
|
|
153
|
+
valueOf() {
|
|
154
|
+
return this._path;
|
|
155
|
+
}
|
|
156
|
+
[Symbol.toPrimitive](_hint) {
|
|
157
|
+
return this._path;
|
|
158
|
+
}
|
|
159
|
+
/* v8 ignore start -- browser stubs for filesystem operations @preserve */
|
|
160
|
+
/* eslint-disable @typescript-eslint/require-await */
|
|
161
|
+
async exists() {
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
async isFile() {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
async isDir() {
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
async isSymlink() {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
async stat() {
|
|
174
|
+
throw new Error("Path.stat is not supported in browser environment");
|
|
175
|
+
}
|
|
176
|
+
async lstat() {
|
|
177
|
+
throw new Error("Path.lstat is not supported in browser environment");
|
|
178
|
+
}
|
|
179
|
+
async readText(_encoding) {
|
|
180
|
+
throw new Error("Path.readText is not supported in browser environment");
|
|
181
|
+
}
|
|
182
|
+
async writeText(_content, _encoding) {
|
|
183
|
+
throw new Error("Path.writeText is not supported in browser environment");
|
|
184
|
+
}
|
|
185
|
+
async readBytes() {
|
|
186
|
+
throw new Error("Path.readBytes is not supported in browser environment");
|
|
187
|
+
}
|
|
188
|
+
async writeBytes(_content) {
|
|
189
|
+
throw new Error("Path.writeBytes is not supported in browser environment");
|
|
190
|
+
}
|
|
191
|
+
async mkdir(_options) {
|
|
192
|
+
throw new Error("Path.mkdir is not supported in browser environment");
|
|
193
|
+
}
|
|
194
|
+
async rmdir() {
|
|
195
|
+
throw new Error("Path.rmdir is not supported in browser environment");
|
|
196
|
+
}
|
|
197
|
+
async unlink() {
|
|
198
|
+
throw new Error("Path.unlink is not supported in browser environment");
|
|
199
|
+
}
|
|
200
|
+
async rename(_target) {
|
|
201
|
+
throw new Error("Path.rename is not supported in browser environment");
|
|
202
|
+
}
|
|
203
|
+
async replace(_target) {
|
|
204
|
+
throw new Error("Path.replace is not supported in browser environment");
|
|
205
|
+
}
|
|
206
|
+
resolve() {
|
|
207
|
+
return new _Path(normalize(this._path));
|
|
208
|
+
}
|
|
209
|
+
absolute() {
|
|
210
|
+
if (this.isAbsolute()) {
|
|
211
|
+
return this.resolve();
|
|
212
|
+
}
|
|
213
|
+
return new _Path(SEP + this._path).resolve();
|
|
214
|
+
}
|
|
215
|
+
async readlink() {
|
|
216
|
+
throw new Error("Path.readlink is not supported in browser environment");
|
|
217
|
+
}
|
|
218
|
+
async symlinkTo(_target) {
|
|
219
|
+
throw new Error("Path.symlinkTo is not supported in browser environment");
|
|
220
|
+
}
|
|
221
|
+
async linkTo(_target) {
|
|
222
|
+
throw new Error("Path.linkTo is not supported in browser environment");
|
|
223
|
+
}
|
|
224
|
+
async chmod(_mode) {
|
|
225
|
+
throw new Error("Path.chmod is not supported in browser environment");
|
|
226
|
+
}
|
|
227
|
+
async touch(_options) {
|
|
228
|
+
throw new Error("Path.touch is not supported in browser environment");
|
|
229
|
+
}
|
|
230
|
+
async iterdir() {
|
|
231
|
+
throw new Error("Path.iterdir is not supported in browser environment");
|
|
232
|
+
}
|
|
233
|
+
async glob(_pattern) {
|
|
234
|
+
return [];
|
|
235
|
+
}
|
|
236
|
+
async rglob(_pattern) {
|
|
237
|
+
return [];
|
|
238
|
+
}
|
|
239
|
+
/* v8 ignore stop */
|
|
240
|
+
};
|
|
241
|
+
var PurePath = Path;
|
|
242
|
+
var PurePosixPath = Path;
|
|
243
|
+
var PureWindowsPath = Path;
|
|
244
|
+
var PosixPath = Path;
|
|
245
|
+
var WindowsPath = Path;
|
|
246
|
+
|
|
247
|
+
export {
|
|
248
|
+
Path,
|
|
249
|
+
PurePath,
|
|
250
|
+
PurePosixPath,
|
|
251
|
+
PureWindowsPath,
|
|
252
|
+
PosixPath,
|
|
253
|
+
WindowsPath,
|
|
254
|
+
pathlib_browser_exports
|
|
255
|
+
};
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-MLKGABMK.js";
|
|
4
|
+
|
|
5
|
+
// src/urllib.ts
|
|
6
|
+
var urllib_exports = {};
|
|
7
|
+
__export(urllib_exports, {
|
|
8
|
+
parse: () => parse,
|
|
9
|
+
parseQs: () => parseQs,
|
|
10
|
+
parseQsl: () => parseQsl,
|
|
11
|
+
quote: () => quote,
|
|
12
|
+
quotePlus: () => quotePlus,
|
|
13
|
+
splithost: () => splithost,
|
|
14
|
+
splitpasswd: () => splitpasswd,
|
|
15
|
+
splitport: () => splitport,
|
|
16
|
+
splittype: () => splittype,
|
|
17
|
+
splituser: () => splituser,
|
|
18
|
+
unquote: () => unquote,
|
|
19
|
+
unquotePlus: () => unquotePlus,
|
|
20
|
+
urlencode: () => urlencode,
|
|
21
|
+
urljoin: () => urljoin,
|
|
22
|
+
urlparse: () => urlparse,
|
|
23
|
+
urlunparse: () => urlunparse
|
|
24
|
+
});
|
|
25
|
+
function urlparse(urlstring, scheme = "", allowFragments = true) {
|
|
26
|
+
try {
|
|
27
|
+
let url;
|
|
28
|
+
if (!urlstring.includes("://")) {
|
|
29
|
+
url = new URL((scheme || "http") + "://" + urlstring);
|
|
30
|
+
} else {
|
|
31
|
+
url = new URL(urlstring);
|
|
32
|
+
}
|
|
33
|
+
let fragment = "";
|
|
34
|
+
if (allowFragments && url.hash) {
|
|
35
|
+
fragment = url.hash.slice(1);
|
|
36
|
+
}
|
|
37
|
+
let netloc = url.host;
|
|
38
|
+
if (url.username) {
|
|
39
|
+
const userinfo = url.password ? `${url.username}:${url.password}` : url.username;
|
|
40
|
+
netloc = `${userinfo}@${url.host}`;
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
scheme: url.protocol.slice(0, -1),
|
|
44
|
+
netloc,
|
|
45
|
+
path: url.pathname,
|
|
46
|
+
params: "",
|
|
47
|
+
query: url.search ? url.search.slice(1) : "",
|
|
48
|
+
fragment,
|
|
49
|
+
username: url.username || null,
|
|
50
|
+
password: url.password || null,
|
|
51
|
+
hostname: url.hostname || null,
|
|
52
|
+
port: url.port ? parseInt(url.port, 10) : null
|
|
53
|
+
};
|
|
54
|
+
} catch {
|
|
55
|
+
return {
|
|
56
|
+
scheme,
|
|
57
|
+
netloc: "",
|
|
58
|
+
path: urlstring,
|
|
59
|
+
params: "",
|
|
60
|
+
query: "",
|
|
61
|
+
fragment: "",
|
|
62
|
+
username: null,
|
|
63
|
+
password: null,
|
|
64
|
+
hostname: null,
|
|
65
|
+
port: null
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function urlunparse(components) {
|
|
70
|
+
let scheme, netloc, path, params, query, fragment;
|
|
71
|
+
if (Array.isArray(components)) {
|
|
72
|
+
;
|
|
73
|
+
[scheme, netloc, path, params, query, fragment] = components;
|
|
74
|
+
} else {
|
|
75
|
+
;
|
|
76
|
+
({ scheme, netloc, path, params, query, fragment } = components);
|
|
77
|
+
}
|
|
78
|
+
let url = "";
|
|
79
|
+
if (scheme) {
|
|
80
|
+
url += scheme + "://";
|
|
81
|
+
}
|
|
82
|
+
if (netloc) {
|
|
83
|
+
url += netloc;
|
|
84
|
+
}
|
|
85
|
+
url += path;
|
|
86
|
+
if (params) {
|
|
87
|
+
url += ";" + params;
|
|
88
|
+
}
|
|
89
|
+
if (query) {
|
|
90
|
+
url += "?" + query;
|
|
91
|
+
}
|
|
92
|
+
if (fragment) {
|
|
93
|
+
url += "#" + fragment;
|
|
94
|
+
}
|
|
95
|
+
return url;
|
|
96
|
+
}
|
|
97
|
+
function urljoin(base, url, allowFragments = true) {
|
|
98
|
+
if (!base) return url;
|
|
99
|
+
if (!url) return base;
|
|
100
|
+
try {
|
|
101
|
+
const result = new URL(url, base);
|
|
102
|
+
if (!allowFragments) {
|
|
103
|
+
result.hash = "";
|
|
104
|
+
}
|
|
105
|
+
return result.href;
|
|
106
|
+
} catch {
|
|
107
|
+
return url;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function urlencode(query, doseq = false) {
|
|
111
|
+
const params = new URLSearchParams();
|
|
112
|
+
if (Array.isArray(query)) {
|
|
113
|
+
for (const [key, value] of query) {
|
|
114
|
+
params.append(key, value);
|
|
115
|
+
}
|
|
116
|
+
} else {
|
|
117
|
+
for (const [key, value] of Object.entries(query)) {
|
|
118
|
+
if (Array.isArray(value) && doseq) {
|
|
119
|
+
for (const v of value) {
|
|
120
|
+
params.append(key, v);
|
|
121
|
+
}
|
|
122
|
+
} else if (Array.isArray(value)) {
|
|
123
|
+
params.append(key, value.join(","));
|
|
124
|
+
} else {
|
|
125
|
+
params.append(key, value);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return params.toString();
|
|
130
|
+
}
|
|
131
|
+
function parseQs(qs, keepBlankValues = false) {
|
|
132
|
+
const result = {};
|
|
133
|
+
const params = new URLSearchParams(qs);
|
|
134
|
+
for (const [key, value] of params) {
|
|
135
|
+
if (!keepBlankValues && value === "") {
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (!(key in result)) {
|
|
139
|
+
result[key] = [];
|
|
140
|
+
}
|
|
141
|
+
result[key]?.push(value);
|
|
142
|
+
}
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
145
|
+
function parseQsl(qs, keepBlankValues = false) {
|
|
146
|
+
const result = [];
|
|
147
|
+
const params = new URLSearchParams(qs);
|
|
148
|
+
for (const [key, value] of params) {
|
|
149
|
+
if (!keepBlankValues && value === "") {
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
result.push([key, value]);
|
|
153
|
+
}
|
|
154
|
+
return result;
|
|
155
|
+
}
|
|
156
|
+
function quote(s, safe = "") {
|
|
157
|
+
let result = encodeURIComponent(s);
|
|
158
|
+
for (const char of safe) {
|
|
159
|
+
result = result.replace(new RegExp(encodeURIComponent(char), "g"), char);
|
|
160
|
+
}
|
|
161
|
+
return result;
|
|
162
|
+
}
|
|
163
|
+
function quotePlus(s, safe = "") {
|
|
164
|
+
return quote(s, safe).replace(/%20/g, "+");
|
|
165
|
+
}
|
|
166
|
+
function unquote(s) {
|
|
167
|
+
return decodeURIComponent(s);
|
|
168
|
+
}
|
|
169
|
+
function unquotePlus(s) {
|
|
170
|
+
return decodeURIComponent(s.replace(/\+/g, " "));
|
|
171
|
+
}
|
|
172
|
+
function splittype(url) {
|
|
173
|
+
const match = /^([a-zA-Z][a-zA-Z0-9+.-]*):(.*)$/.exec(url);
|
|
174
|
+
if (match) {
|
|
175
|
+
return [match[1] ?? "", match[2] ?? ""];
|
|
176
|
+
}
|
|
177
|
+
return ["", url];
|
|
178
|
+
}
|
|
179
|
+
function splithost(url) {
|
|
180
|
+
const match = /^\/\/([^/?#]*)(.*)$/.exec(url);
|
|
181
|
+
if (match) {
|
|
182
|
+
return [match[1] ?? null, match[2] ?? ""];
|
|
183
|
+
}
|
|
184
|
+
return [null, url];
|
|
185
|
+
}
|
|
186
|
+
function splituser(host) {
|
|
187
|
+
const match = /^([^@]*)@(.*)$/.exec(host);
|
|
188
|
+
if (match) {
|
|
189
|
+
return [match[1] ?? null, match[2] ?? ""];
|
|
190
|
+
}
|
|
191
|
+
return [null, host];
|
|
192
|
+
}
|
|
193
|
+
function splitpasswd(user) {
|
|
194
|
+
const match = /^([^:]*):(.*)$/.exec(user);
|
|
195
|
+
if (match) {
|
|
196
|
+
return [match[1] ?? "", match[2] ?? null];
|
|
197
|
+
}
|
|
198
|
+
return [user, null];
|
|
199
|
+
}
|
|
200
|
+
function splitport(host) {
|
|
201
|
+
if (host.startsWith("[")) {
|
|
202
|
+
const match2 = /^\[([^\]]+)\]:?(\d*)$/.exec(host);
|
|
203
|
+
if (match2) {
|
|
204
|
+
return [match2[1] ?? "", match2[2] ?? null];
|
|
205
|
+
}
|
|
206
|
+
return [host, null];
|
|
207
|
+
}
|
|
208
|
+
const match = /^(.*):(\d+)$/.exec(host);
|
|
209
|
+
if (match) {
|
|
210
|
+
return [match[1] ?? "", match[2] ?? null];
|
|
211
|
+
}
|
|
212
|
+
return [host, null];
|
|
213
|
+
}
|
|
214
|
+
var parse = {
|
|
215
|
+
urlparse,
|
|
216
|
+
urlunparse,
|
|
217
|
+
urljoin,
|
|
218
|
+
urlencode,
|
|
219
|
+
parseQs,
|
|
220
|
+
parseQsl,
|
|
221
|
+
quote,
|
|
222
|
+
quotePlus,
|
|
223
|
+
unquote,
|
|
224
|
+
unquotePlus,
|
|
225
|
+
splittype,
|
|
226
|
+
splithost,
|
|
227
|
+
splituser,
|
|
228
|
+
splitpasswd,
|
|
229
|
+
splitport
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
export {
|
|
233
|
+
urlparse,
|
|
234
|
+
urlunparse,
|
|
235
|
+
urljoin,
|
|
236
|
+
urlencode,
|
|
237
|
+
parseQs,
|
|
238
|
+
parseQsl,
|
|
239
|
+
quote,
|
|
240
|
+
quotePlus,
|
|
241
|
+
unquote,
|
|
242
|
+
unquotePlus,
|
|
243
|
+
splittype,
|
|
244
|
+
splithost,
|
|
245
|
+
splituser,
|
|
246
|
+
splitpasswd,
|
|
247
|
+
splitport,
|
|
248
|
+
parse,
|
|
249
|
+
urllib_exports
|
|
250
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MLKGABMK.js";
|
|
4
4
|
|
|
5
5
|
// src/json.ts
|
|
6
6
|
var json_exports = {};
|
|
@@ -106,4 +106,3 @@ export {
|
|
|
106
106
|
};
|
|
107
107
|
/* v8 ignore start -- error handling for invalid JSON @preserve */
|
|
108
108
|
/* v8 ignore start -- advanced custom parser hooks @preserve */
|
|
109
|
-
//# sourceMappingURL=chunk-4KYJT3DR.js.map
|