pythonlib 0.1.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 +183 -0
- package/dist/chunk-3CSEXTA7.js +376 -0
- package/dist/chunk-3CSEXTA7.js.map +1 -0
- package/dist/chunk-HA5Y7PKO.js +680 -0
- package/dist/chunk-HA5Y7PKO.js.map +1 -0
- package/dist/chunk-IVYYI2VR.js +261 -0
- package/dist/chunk-IVYYI2VR.js.map +1 -0
- package/dist/chunk-OMQNGE6T.js +245 -0
- package/dist/chunk-OMQNGE6T.js.map +1 -0
- package/dist/chunk-P3SGIF72.js +107 -0
- package/dist/chunk-P3SGIF72.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/chunk-TJFGYXBJ.js +310 -0
- package/dist/chunk-TJFGYXBJ.js.map +1 -0
- package/dist/chunk-TOI6IG3T.js +337 -0
- package/dist/chunk-TOI6IG3T.js.map +1 -0
- package/dist/chunk-UFMTN4T4.js +215 -0
- package/dist/chunk-UFMTN4T4.js.map +1 -0
- package/dist/chunk-V63LKSA3.js +423 -0
- package/dist/chunk-V63LKSA3.js.map +1 -0
- package/dist/chunk-WAONBJE5.js +236 -0
- package/dist/chunk-WAONBJE5.js.map +1 -0
- package/dist/collections-xN9Gi0TA.d.ts +113 -0
- package/dist/collections.d.ts +1 -0
- package/dist/collections.js +12 -0
- package/dist/collections.js.map +1 -0
- package/dist/datetime-DRwFAiGV.d.ts +139 -0
- package/dist/datetime.d.ts +1 -0
- package/dist/datetime.js +22 -0
- package/dist/datetime.js.map +1 -0
- package/dist/functools-St5GqpKG.d.ts +125 -0
- package/dist/functools.d.ts +1 -0
- package/dist/functools.js +32 -0
- package/dist/functools.js.map +1 -0
- package/dist/index.d.ts +624 -0
- package/dist/index.js +1332 -0
- package/dist/index.js.map +1 -0
- package/dist/itertools-Bj8XivI6.d.ts +138 -0
- package/dist/itertools.d.ts +1 -0
- package/dist/itertools.js +44 -0
- package/dist/itertools.js.map +1 -0
- package/dist/json-Xpk0kwSd.d.ts +77 -0
- package/dist/json.d.ts +1 -0
- package/dist/json.js +14 -0
- package/dist/json.js.map +1 -0
- package/dist/math-BrT4Aw3E.d.ts +147 -0
- package/dist/math.d.ts +1 -0
- package/dist/math.js +96 -0
- package/dist/math.js.map +1 -0
- package/dist/os-FRSJbEUH.d.ts +143 -0
- package/dist/os.d.ts +1 -0
- package/dist/os.js +58 -0
- package/dist/os.js.map +1 -0
- package/dist/random-D5S5iSV3.d.ts +72 -0
- package/dist/random.d.ts +1 -0
- package/dist/random.js +42 -0
- package/dist/random.js.map +1 -0
- package/dist/re-DSxiURqN.d.ts +148 -0
- package/dist/re.d.ts +1 -0
- package/dist/re.js +52 -0
- package/dist/re.js.map +1 -0
- package/dist/string.d.ts +166 -0
- package/dist/string.js +30 -0
- package/dist/string.js.map +1 -0
- package/package.json +85 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-PZ5AY32C.js";
|
|
4
|
+
|
|
5
|
+
// src/json.ts
|
|
6
|
+
var json_exports = {};
|
|
7
|
+
__export(json_exports, {
|
|
8
|
+
dump: () => dump,
|
|
9
|
+
dumps: () => dumps,
|
|
10
|
+
load: () => load,
|
|
11
|
+
loads: () => loads
|
|
12
|
+
});
|
|
13
|
+
function dumps(obj, options) {
|
|
14
|
+
const indent = options?.indent;
|
|
15
|
+
const sortKeys = options?.sort_keys ?? false;
|
|
16
|
+
const defaultFn = options?.default;
|
|
17
|
+
const ensureAscii = options?.ensure_ascii ?? true;
|
|
18
|
+
const replacer = sortKeys ? (_key, value) => {
|
|
19
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
20
|
+
const sorted = {};
|
|
21
|
+
for (const k of Object.keys(value).sort()) {
|
|
22
|
+
sorted[k] = value[k];
|
|
23
|
+
}
|
|
24
|
+
return sorted;
|
|
25
|
+
}
|
|
26
|
+
return value;
|
|
27
|
+
} : void 0;
|
|
28
|
+
let result;
|
|
29
|
+
try {
|
|
30
|
+
if (defaultFn) {
|
|
31
|
+
result = JSON.stringify(
|
|
32
|
+
obj,
|
|
33
|
+
(key, value) => {
|
|
34
|
+
const processed = replacer ? replacer(key, value) : value;
|
|
35
|
+
try {
|
|
36
|
+
JSON.stringify(processed);
|
|
37
|
+
return processed;
|
|
38
|
+
} catch {
|
|
39
|
+
return defaultFn(processed);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
indent
|
|
43
|
+
);
|
|
44
|
+
} else {
|
|
45
|
+
result = JSON.stringify(obj, replacer, indent);
|
|
46
|
+
}
|
|
47
|
+
} catch (e) {
|
|
48
|
+
const error = e;
|
|
49
|
+
throw new Error(`Object of type ${typeof obj} is not JSON serializable: ${error.message}`);
|
|
50
|
+
}
|
|
51
|
+
if (options?.separators) {
|
|
52
|
+
const [itemSep, keySep] = options.separators;
|
|
53
|
+
if (itemSep !== ", " || keySep !== ": ") {
|
|
54
|
+
result = result.replace(/,\s*/g, itemSep).replace(/:\s*/g, keySep);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (ensureAscii) {
|
|
58
|
+
result = result.replace(/[\u007f-\uffff]/g, (char) => {
|
|
59
|
+
return "\\u" + ("0000" + char.charCodeAt(0).toString(16)).slice(-4);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
64
|
+
function loads(s, options) {
|
|
65
|
+
const objectHook = options?.object_hook;
|
|
66
|
+
const parseFloat = options?.parse_float;
|
|
67
|
+
const parseInt = options?.parse_int;
|
|
68
|
+
let reviver;
|
|
69
|
+
if (objectHook || parseFloat || parseInt) {
|
|
70
|
+
reviver = (key, value) => {
|
|
71
|
+
if (typeof value === "number") {
|
|
72
|
+
const str = String(value);
|
|
73
|
+
if (str.includes(".") || str.includes("e") || str.includes("E")) {
|
|
74
|
+
return parseFloat ? parseFloat(str) : value;
|
|
75
|
+
}
|
|
76
|
+
return parseInt ? parseInt(str) : value;
|
|
77
|
+
}
|
|
78
|
+
if (objectHook && value && typeof value === "object" && !Array.isArray(value) && key === "") {
|
|
79
|
+
return objectHook(value);
|
|
80
|
+
}
|
|
81
|
+
return value;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
return JSON.parse(s, reviver);
|
|
86
|
+
} catch (e) {
|
|
87
|
+
const error = e;
|
|
88
|
+
throw new Error(`JSON decode error: ${error.message}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function dump(obj, fp, options) {
|
|
92
|
+
const s = dumps(obj, options);
|
|
93
|
+
fp.write(s);
|
|
94
|
+
}
|
|
95
|
+
function load(fp, options) {
|
|
96
|
+
const s = fp.read();
|
|
97
|
+
return loads(s, options);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export {
|
|
101
|
+
dumps,
|
|
102
|
+
loads,
|
|
103
|
+
dump,
|
|
104
|
+
load,
|
|
105
|
+
json_exports
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=chunk-P3SGIF72.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/json.ts"],"sourcesContent":["/**\n * Python json module for TypeScript\n *\n * Provides JSON encoding and decoding functions matching Python's json module.\n * Maps directly to JavaScript's JSON object with Python-compatible options.\n */\n\ntype JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue }\ntype JsonReplacer = (key: string, value: unknown) => unknown\ntype JsonReviver = (key: string, value: unknown) => unknown\n\ninterface DumpsOptions {\n /** If specified, use this many spaces for indentation */\n indent?: number\n /** Separators for items and key-value pairs [item_sep, key_sep] */\n separators?: [string, string]\n /** Sort dictionary keys */\n sort_keys?: boolean\n /** If false, non-ASCII characters are escaped. Default true */\n ensure_ascii?: boolean\n /** Custom serialization function */\n default?: (obj: unknown) => JsonValue\n}\n\ninterface LoadsOptions {\n /** Custom deserialization function */\n object_hook?: (obj: Record<string, unknown>) => unknown\n /** Parse floats with this function */\n parse_float?: (s: string) => number\n /** Parse integers with this function */\n parse_int?: (s: string) => number\n}\n\n/**\n * Serialize obj to a JSON formatted string.\n *\n * @param obj - The object to serialize\n * @param options - Serialization options\n * @returns JSON string\n */\nexport function dumps(obj: unknown, options?: DumpsOptions): string {\n const indent = options?.indent\n const sortKeys = options?.sort_keys ?? false\n const defaultFn = options?.default\n const ensureAscii = options?.ensure_ascii ?? true\n\n const replacer: JsonReplacer | undefined = sortKeys\n ? (_key, value) => {\n if (value && typeof value === \"object\" && !Array.isArray(value)) {\n const sorted: Record<string, unknown> = {}\n for (const k of Object.keys(value as Record<string, unknown>).sort()) {\n sorted[k] = (value as Record<string, unknown>)[k]\n }\n return sorted\n }\n return value\n }\n : undefined\n\n let result: string\n\n try {\n if (defaultFn) {\n // Custom serialization with default function\n result = JSON.stringify(\n obj,\n (key, value: unknown) => {\n const processed: unknown = replacer ? replacer(key, value) : value\n try {\n // Try default serialization first\n JSON.stringify(processed)\n return processed as JsonValue\n } catch {\n // If it fails, use the default function\n return defaultFn(processed)\n }\n },\n indent\n )\n } else {\n result = JSON.stringify(obj, replacer, indent)\n }\n } catch (e) {\n const error = e as Error\n throw new Error(`Object of type ${typeof obj} is not JSON serializable: ${error.message}`)\n }\n\n // Handle separators if specified\n if (options?.separators) {\n const [itemSep, keySep] = options.separators\n // This is a simplified implementation - full separator support would require custom serialization\n if (itemSep !== \", \" || keySep !== \": \") {\n result = result.replace(/,\\s*/g, itemSep).replace(/:\\s*/g, keySep)\n }\n }\n\n // Handle ensure_ascii\n if (ensureAscii) {\n result = result.replace(/[\\u007f-\\uffff]/g, (char) => {\n return \"\\\\u\" + (\"0000\" + char.charCodeAt(0).toString(16)).slice(-4)\n })\n }\n\n return result\n}\n\n/**\n * Deserialize a JSON string to a Python object.\n *\n * @param s - JSON string to parse\n * @param options - Deserialization options\n * @returns Parsed object\n */\nexport function loads(s: string, options?: LoadsOptions): unknown {\n const objectHook = options?.object_hook\n const parseFloat = options?.parse_float\n const parseInt = options?.parse_int\n\n let reviver: JsonReviver | undefined\n\n if (objectHook || parseFloat || parseInt) {\n reviver = (key, value) => {\n if (typeof value === \"number\") {\n const str = String(value)\n if (str.includes(\".\") || str.includes(\"e\") || str.includes(\"E\")) {\n return parseFloat ? parseFloat(str) : value\n }\n return parseInt ? parseInt(str) : value\n }\n if (objectHook && value && typeof value === \"object\" && !Array.isArray(value) && key === \"\") {\n return objectHook(value as Record<string, unknown>)\n }\n return value\n }\n }\n\n try {\n return JSON.parse(s, reviver)\n } catch (e) {\n const error = e as Error\n throw new Error(`JSON decode error: ${error.message}`)\n }\n}\n\n/**\n * Serialize obj to a JSON formatted string and write to file.\n * Note: This is a no-op in browser environments.\n *\n * @param obj - The object to serialize\n * @param fp - File-like object with write method\n * @param options - Serialization options\n */\nexport function dump(\n obj: unknown,\n fp: { write: (s: string) => void },\n options?: DumpsOptions\n): void {\n const s = dumps(obj, options)\n fp.write(s)\n}\n\n/**\n * Deserialize a JSON string from file to a Python object.\n * Note: This is a no-op in browser environments.\n *\n * @param fp - File-like object with read method\n * @param options - Deserialization options\n * @returns Parsed object\n */\nexport function load(fp: { read: () => string }, options?: LoadsOptions): unknown {\n const s = fp.read()\n return loads(s, options)\n}\n"],"mappings":";;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwCO,SAAS,MAAM,KAAc,SAAgC;AAClE,QAAM,SAAS,SAAS;AACxB,QAAM,WAAW,SAAS,aAAa;AACvC,QAAM,YAAY,SAAS;AAC3B,QAAM,cAAc,SAAS,gBAAgB;AAE7C,QAAM,WAAqC,WACvC,CAAC,MAAM,UAAU;AACf,QAAI,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,GAAG;AAC/D,YAAM,SAAkC,CAAC;AACzC,iBAAW,KAAK,OAAO,KAAK,KAAgC,EAAE,KAAK,GAAG;AACpE,eAAO,CAAC,IAAK,MA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KAAK,IAAI,SAAS,GAAG,GAAG;AAC/D,iBAAO,aAAa,WAAW,GAAG,IAAI;AAAA,QACxC;AACA,eAAO,WAAW,SAAS,GAAG,IAAI;AAAA,MACpC;AACA,UAAI,cAAc,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,KAAK,QAAQ,IAAI;AAC3F,eAAO,WAAW,KAAgC;AAAA,MACpD;AACA,aAAO;AAAA,IACT;AAAA,EACF;AAEA,MAAI;AACF,WAAO,KAAK,MAAM,GAAG,OAAO;AAAA,EAC9B,SAAS,GAAG;AACV,UAAM,QAAQ;AACd,UAAM,IAAI,MAAM,sBAAsB,MAAM,OAAO,EAAE;AAAA,EACvD;AACF;AAUO,SAAS,KACd,KACA,IACA,SACM;AACN,QAAM,IAAI,MAAM,KAAK,OAAO;AAC5B,KAAG,MAAM,CAAC;AACZ;AAUO,SAAS,KAAK,IAA4B,SAAiC;AAChF,QAAM,IAAI,GAAG,KAAK;AAClB,SAAO,MAAM,GAAG,OAAO;AACzB;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-PZ5AY32C.js";
|
|
4
|
+
|
|
5
|
+
// src/os.ts
|
|
6
|
+
var os_exports = {};
|
|
7
|
+
__export(os_exports, {
|
|
8
|
+
altsep: () => altsep,
|
|
9
|
+
chdir: () => chdir,
|
|
10
|
+
curdir: () => curdir,
|
|
11
|
+
environ: () => environ,
|
|
12
|
+
extsep: () => extsep,
|
|
13
|
+
getcwd: () => getcwd,
|
|
14
|
+
getcwdb: () => getcwdb,
|
|
15
|
+
getenv: () => getenv,
|
|
16
|
+
linesep: () => linesep,
|
|
17
|
+
listdir: () => listdir,
|
|
18
|
+
makedirs: () => makedirs,
|
|
19
|
+
mkdir: () => mkdir,
|
|
20
|
+
name: () => name,
|
|
21
|
+
pardir: () => pardir,
|
|
22
|
+
path: () => path,
|
|
23
|
+
pathsep: () => pathsep,
|
|
24
|
+
remove: () => remove,
|
|
25
|
+
removedirs: () => removedirs,
|
|
26
|
+
rename: () => rename,
|
|
27
|
+
renames: () => renames,
|
|
28
|
+
replace: () => replace,
|
|
29
|
+
rmdir: () => rmdir,
|
|
30
|
+
sep: () => sep,
|
|
31
|
+
stat: () => stat,
|
|
32
|
+
unlink: () => unlink,
|
|
33
|
+
walk: () => walk
|
|
34
|
+
});
|
|
35
|
+
var environ = typeof process !== "undefined" ? process.env : {};
|
|
36
|
+
function getenv(key, defaultValue) {
|
|
37
|
+
return environ[key] ?? defaultValue;
|
|
38
|
+
}
|
|
39
|
+
var sep = typeof process !== "undefined" && process.platform === "win32" ? "\\" : "/";
|
|
40
|
+
var altsep = typeof process !== "undefined" && process.platform === "win32" ? "/" : null;
|
|
41
|
+
var pathsep = typeof process !== "undefined" && process.platform === "win32" ? ";" : ":";
|
|
42
|
+
var linesep = typeof process !== "undefined" && process.platform === "win32" ? "\r\n" : "\n";
|
|
43
|
+
var curdir = ".";
|
|
44
|
+
var pardir = "..";
|
|
45
|
+
var extsep = ".";
|
|
46
|
+
var path = {
|
|
47
|
+
/** Join path components intelligently */
|
|
48
|
+
join(...paths) {
|
|
49
|
+
if (paths.length === 0) return "";
|
|
50
|
+
if (paths.length === 1) return paths[0] ?? "";
|
|
51
|
+
let result = paths[0] ?? "";
|
|
52
|
+
for (let i = 1; i < paths.length; i++) {
|
|
53
|
+
const p = paths[i] ?? "";
|
|
54
|
+
if (p.startsWith("/") || p.length > 1 && p[1] === ":") {
|
|
55
|
+
result = p;
|
|
56
|
+
} else if (result === "" || result.endsWith("/") || result.endsWith("\\")) {
|
|
57
|
+
result += p;
|
|
58
|
+
} else {
|
|
59
|
+
result += sep + p;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
63
|
+
},
|
|
64
|
+
/** Return the base name of pathname */
|
|
65
|
+
basename(p, suffix) {
|
|
66
|
+
let s = p.replace(/[/\\]+$/, "");
|
|
67
|
+
const idx = Math.max(s.lastIndexOf("/"), s.lastIndexOf("\\"));
|
|
68
|
+
s = idx >= 0 ? s.slice(idx + 1) : s;
|
|
69
|
+
if (suffix && s.endsWith(suffix)) {
|
|
70
|
+
s = s.slice(0, -suffix.length);
|
|
71
|
+
}
|
|
72
|
+
return s;
|
|
73
|
+
},
|
|
74
|
+
/** Return the directory name of pathname */
|
|
75
|
+
dirname(p) {
|
|
76
|
+
const s = p.replace(/[/\\]+$/, "");
|
|
77
|
+
const idx = Math.max(s.lastIndexOf("/"), s.lastIndexOf("\\"));
|
|
78
|
+
if (idx < 0) return "";
|
|
79
|
+
if (idx === 0) return s[0] ?? "";
|
|
80
|
+
return s.slice(0, idx);
|
|
81
|
+
},
|
|
82
|
+
/** Split pathname into (head, tail) */
|
|
83
|
+
split(p) {
|
|
84
|
+
return [path.dirname(p), path.basename(p)];
|
|
85
|
+
},
|
|
86
|
+
/** Split pathname into root and extension */
|
|
87
|
+
splitext(p) {
|
|
88
|
+
const base = path.basename(p);
|
|
89
|
+
const dotIdx = base.lastIndexOf(".");
|
|
90
|
+
if (dotIdx <= 0) {
|
|
91
|
+
return [p, ""];
|
|
92
|
+
}
|
|
93
|
+
const dir = path.dirname(p);
|
|
94
|
+
const root = base.slice(0, dotIdx);
|
|
95
|
+
const ext = base.slice(dotIdx);
|
|
96
|
+
return [dir ? path.join(dir, root) : root, ext];
|
|
97
|
+
},
|
|
98
|
+
/** Return the extension of pathname */
|
|
99
|
+
extname(p) {
|
|
100
|
+
return path.splitext(p)[1];
|
|
101
|
+
},
|
|
102
|
+
/** Test whether a path is absolute */
|
|
103
|
+
isabs(p) {
|
|
104
|
+
if (p.startsWith("/")) return true;
|
|
105
|
+
if (p.length >= 3 && p[1] === ":" && (p[2] === "/" || p[2] === "\\")) return true;
|
|
106
|
+
if (p.startsWith("\\\\")) return true;
|
|
107
|
+
return false;
|
|
108
|
+
},
|
|
109
|
+
/** Normalize a pathname */
|
|
110
|
+
normpath(p) {
|
|
111
|
+
if (!p) return ".";
|
|
112
|
+
let prefix = "";
|
|
113
|
+
if (p.length >= 2 && p[1] === ":") {
|
|
114
|
+
prefix = p.slice(0, 2);
|
|
115
|
+
p = p.slice(2);
|
|
116
|
+
}
|
|
117
|
+
const isWin = p.includes("\\");
|
|
118
|
+
p = p.replace(/\\/g, "/");
|
|
119
|
+
const isAbsolute = p.startsWith("/");
|
|
120
|
+
const parts = p.split("/").filter((part) => part && part !== ".");
|
|
121
|
+
const result = [];
|
|
122
|
+
for (const part of parts) {
|
|
123
|
+
if (part === "..") {
|
|
124
|
+
if (result.length > 0 && result[result.length - 1] !== "..") {
|
|
125
|
+
result.pop();
|
|
126
|
+
} else if (!isAbsolute) {
|
|
127
|
+
result.push("..");
|
|
128
|
+
}
|
|
129
|
+
} else {
|
|
130
|
+
result.push(part);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
let normalized = result.join(isWin ? "\\" : "/");
|
|
134
|
+
if (isAbsolute) {
|
|
135
|
+
normalized = (isWin ? "\\" : "/") + normalized;
|
|
136
|
+
}
|
|
137
|
+
normalized = prefix + normalized;
|
|
138
|
+
return normalized || ".";
|
|
139
|
+
},
|
|
140
|
+
/** Return normalized absolutized version of pathname */
|
|
141
|
+
abspath(p) {
|
|
142
|
+
if (path.isabs(p)) {
|
|
143
|
+
return path.normpath(p);
|
|
144
|
+
}
|
|
145
|
+
return path.normpath(p);
|
|
146
|
+
},
|
|
147
|
+
/** Return canonical path, eliminating symlinks (stub - just normalizes) */
|
|
148
|
+
realpath(p) {
|
|
149
|
+
return path.abspath(p);
|
|
150
|
+
},
|
|
151
|
+
/** Return relative path from start to path */
|
|
152
|
+
relpath(p, start = ".") {
|
|
153
|
+
const pParts = path.normpath(p).split(/[/\\]/).filter(Boolean);
|
|
154
|
+
const startParts = path.normpath(start).split(/[/\\]/).filter(Boolean);
|
|
155
|
+
let commonLen = 0;
|
|
156
|
+
const minLen = Math.min(pParts.length, startParts.length);
|
|
157
|
+
for (let i = 0; i < minLen; i++) {
|
|
158
|
+
if (pParts[i] === startParts[i]) {
|
|
159
|
+
commonLen++;
|
|
160
|
+
} else {
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const upCount = startParts.length - commonLen;
|
|
165
|
+
const result = [...Array(upCount).fill(".."), ...pParts.slice(commonLen)];
|
|
166
|
+
return result.join(sep) || ".";
|
|
167
|
+
},
|
|
168
|
+
/** Return common path prefix */
|
|
169
|
+
commonpath(paths) {
|
|
170
|
+
if (paths.length === 0) {
|
|
171
|
+
throw new Error("commonpath() arg is an empty sequence");
|
|
172
|
+
}
|
|
173
|
+
const splitPaths = paths.map((p) => path.normpath(p).split(/[/\\]/));
|
|
174
|
+
const first = splitPaths[0];
|
|
175
|
+
let commonLen = first.length;
|
|
176
|
+
for (let i = 1; i < splitPaths.length; i++) {
|
|
177
|
+
const parts = splitPaths[i];
|
|
178
|
+
commonLen = Math.min(commonLen, parts.length);
|
|
179
|
+
for (let j = 0; j < commonLen; j++) {
|
|
180
|
+
if (parts[j] !== first[j]) {
|
|
181
|
+
commonLen = j;
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return first.slice(0, commonLen).join(sep) || sep;
|
|
187
|
+
},
|
|
188
|
+
/** Expand ~ and ~user (stub - returns unchanged in browser) */
|
|
189
|
+
expanduser(p) {
|
|
190
|
+
if (!p.startsWith("~")) return p;
|
|
191
|
+
const home = typeof process !== "undefined" ? process.env.HOME ?? process.env.USERPROFILE : void 0;
|
|
192
|
+
if (!home) return p;
|
|
193
|
+
if (p === "~" || p.startsWith("~/") || p.startsWith("~\\")) {
|
|
194
|
+
return home + p.slice(1);
|
|
195
|
+
}
|
|
196
|
+
return p;
|
|
197
|
+
},
|
|
198
|
+
/** Expand shell variables (stub - returns unchanged) */
|
|
199
|
+
expandvars(p) {
|
|
200
|
+
return p.replace(/\$(\w+)|\$\{(\w+)\}/g, (_, v1, v2) => {
|
|
201
|
+
const key = v1 || v2;
|
|
202
|
+
return environ[key] ?? "";
|
|
203
|
+
});
|
|
204
|
+
},
|
|
205
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
206
|
+
/** Test if path exists (stub - always returns false in browser) */
|
|
207
|
+
exists(_p) {
|
|
208
|
+
return false;
|
|
209
|
+
},
|
|
210
|
+
/** Test if path is a file (stub - always returns false in browser) */
|
|
211
|
+
isfile(_p) {
|
|
212
|
+
return false;
|
|
213
|
+
},
|
|
214
|
+
/** Test if path is a directory (stub - always returns false in browser) */
|
|
215
|
+
isdir(_p) {
|
|
216
|
+
return false;
|
|
217
|
+
},
|
|
218
|
+
/** Test if path is a symbolic link (stub - always returns false in browser) */
|
|
219
|
+
islink(_p) {
|
|
220
|
+
return false;
|
|
221
|
+
},
|
|
222
|
+
/** Return size of file (stub - returns 0 in browser) */
|
|
223
|
+
getsize(_p) {
|
|
224
|
+
return 0;
|
|
225
|
+
},
|
|
226
|
+
/** Return modification time (stub - returns 0 in browser) */
|
|
227
|
+
getmtime(_p) {
|
|
228
|
+
return 0;
|
|
229
|
+
},
|
|
230
|
+
/** Return access time (stub - returns 0 in browser) */
|
|
231
|
+
getatime(_p) {
|
|
232
|
+
return 0;
|
|
233
|
+
},
|
|
234
|
+
/** Return creation time (stub - returns 0 in browser) */
|
|
235
|
+
getctime(_p) {
|
|
236
|
+
return 0;
|
|
237
|
+
}
|
|
238
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
239
|
+
};
|
|
240
|
+
function getcwd() {
|
|
241
|
+
if (typeof process !== "undefined") {
|
|
242
|
+
return process.cwd();
|
|
243
|
+
}
|
|
244
|
+
return "/";
|
|
245
|
+
}
|
|
246
|
+
function getcwdb() {
|
|
247
|
+
return getcwd();
|
|
248
|
+
}
|
|
249
|
+
function chdir(p) {
|
|
250
|
+
if (typeof process !== "undefined") {
|
|
251
|
+
process.chdir(p);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
function listdir(_p = ".") {
|
|
255
|
+
return [];
|
|
256
|
+
}
|
|
257
|
+
function mkdir(_p, _mode = 511) {
|
|
258
|
+
}
|
|
259
|
+
function makedirs(_p, _mode = 511, _existOk = false) {
|
|
260
|
+
}
|
|
261
|
+
function remove(_p) {
|
|
262
|
+
}
|
|
263
|
+
var unlink = remove;
|
|
264
|
+
function rmdir(_p) {
|
|
265
|
+
}
|
|
266
|
+
function removedirs(_p) {
|
|
267
|
+
}
|
|
268
|
+
function rename(_src, _dst) {
|
|
269
|
+
}
|
|
270
|
+
function renames(_src, _dst) {
|
|
271
|
+
}
|
|
272
|
+
function replace(_src, _dst) {
|
|
273
|
+
}
|
|
274
|
+
function* walk(_top, _options) {
|
|
275
|
+
}
|
|
276
|
+
function stat(_p) {
|
|
277
|
+
return { st_mode: 0, st_size: 0, st_mtime: 0, st_atime: 0, st_ctime: 0 };
|
|
278
|
+
}
|
|
279
|
+
var name = typeof process !== "undefined" && process.platform === "win32" ? "nt" : "posix";
|
|
280
|
+
|
|
281
|
+
export {
|
|
282
|
+
environ,
|
|
283
|
+
getenv,
|
|
284
|
+
sep,
|
|
285
|
+
altsep,
|
|
286
|
+
pathsep,
|
|
287
|
+
linesep,
|
|
288
|
+
curdir,
|
|
289
|
+
pardir,
|
|
290
|
+
extsep,
|
|
291
|
+
path,
|
|
292
|
+
getcwd,
|
|
293
|
+
getcwdb,
|
|
294
|
+
chdir,
|
|
295
|
+
listdir,
|
|
296
|
+
mkdir,
|
|
297
|
+
makedirs,
|
|
298
|
+
remove,
|
|
299
|
+
unlink,
|
|
300
|
+
rmdir,
|
|
301
|
+
removedirs,
|
|
302
|
+
rename,
|
|
303
|
+
renames,
|
|
304
|
+
replace,
|
|
305
|
+
walk,
|
|
306
|
+
stat,
|
|
307
|
+
name,
|
|
308
|
+
os_exports
|
|
309
|
+
};
|
|
310
|
+
//# sourceMappingURL=chunk-TJFGYXBJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/os.ts"],"sourcesContent":["/**\n * Python os module for TypeScript\n *\n * Provides operating system interface functions matching Python's os module.\n * Note: This is a browser-compatible subset. Some functions are stubs.\n */\n\n// ============================================================================\n// Environment variables\n// ============================================================================\n\n/** Environment variables (browser-safe empty object or Node's process.env) */\nexport const environ: Record<string, string | undefined> =\n typeof process !== \"undefined\" ? process.env : {}\n\n/** Get an environment variable */\nexport function getenv(key: string, defaultValue?: string): string | undefined {\n return environ[key] ?? defaultValue\n}\n\n// ============================================================================\n// Path separator constants\n// ============================================================================\n\n/** Path separator for the current platform */\nexport const sep = typeof process !== \"undefined\" && process.platform === \"win32\" ? \"\\\\\" : \"/\"\n\n/** Alternative path separator (Windows has both / and \\) */\nexport const altsep = typeof process !== \"undefined\" && process.platform === \"win32\" ? \"/\" : null\n\n/** Path list separator (: on Unix, ; on Windows) */\nexport const pathsep = typeof process !== \"undefined\" && process.platform === \"win32\" ? \";\" : \":\"\n\n/** Line separator */\nexport const linesep =\n typeof process !== \"undefined\" && process.platform === \"win32\" ? \"\\r\\n\" : \"\\n\"\n\n/** Current directory string */\nexport const curdir = \".\"\n\n/** Parent directory string */\nexport const pardir = \"..\"\n\n/** Extension separator */\nexport const extsep = \".\"\n\n// ============================================================================\n// os.path module\n// ============================================================================\n\nexport const path = {\n /** Join path components intelligently */\n join(...paths: string[]): string {\n if (paths.length === 0) return \"\"\n if (paths.length === 1) return paths[0] ?? \"\"\n\n let result = paths[0] ?? \"\"\n for (let i = 1; i < paths.length; i++) {\n const p = paths[i] ?? \"\"\n if (p.startsWith(\"/\") || (p.length > 1 && p[1] === \":\")) {\n // Absolute path - start fresh\n result = p\n } else if (result === \"\" || result.endsWith(\"/\") || result.endsWith(\"\\\\\")) {\n result += p\n } else {\n result += sep + p\n }\n }\n return result\n },\n\n /** Return the base name of pathname */\n basename(p: string, suffix?: string): string {\n // Remove trailing slashes\n let s = p.replace(/[/\\\\]+$/, \"\")\n // Get last component\n const idx = Math.max(s.lastIndexOf(\"/\"), s.lastIndexOf(\"\\\\\"))\n s = idx >= 0 ? s.slice(idx + 1) : s\n // Remove suffix if provided\n if (suffix && s.endsWith(suffix)) {\n s = s.slice(0, -suffix.length)\n }\n return s\n },\n\n /** Return the directory name of pathname */\n dirname(p: string): string {\n // Remove trailing slashes\n const s = p.replace(/[/\\\\]+$/, \"\")\n const idx = Math.max(s.lastIndexOf(\"/\"), s.lastIndexOf(\"\\\\\"))\n if (idx < 0) return \"\"\n if (idx === 0) return s[0] ?? \"\"\n return s.slice(0, idx)\n },\n\n /** Split pathname into (head, tail) */\n split(p: string): [string, string] {\n return [path.dirname(p), path.basename(p)]\n },\n\n /** Split pathname into root and extension */\n splitext(p: string): [string, string] {\n const base = path.basename(p)\n const dotIdx = base.lastIndexOf(\".\")\n if (dotIdx <= 0) {\n return [p, \"\"]\n }\n const dir = path.dirname(p)\n const root = base.slice(0, dotIdx)\n const ext = base.slice(dotIdx)\n return [dir ? path.join(dir, root) : root, ext]\n },\n\n /** Return the extension of pathname */\n extname(p: string): string {\n return path.splitext(p)[1]\n },\n\n /** Test whether a path is absolute */\n isabs(p: string): boolean {\n if (p.startsWith(\"/\")) return true\n // Windows: C:\\ or C:/\n if (p.length >= 3 && p[1] === \":\" && (p[2] === \"/\" || p[2] === \"\\\\\")) return true\n // Windows UNC: \\\\server\\share\n if (p.startsWith(\"\\\\\\\\\")) return true\n return false\n },\n\n /** Normalize a pathname */\n normpath(p: string): string {\n if (!p) return \".\"\n\n // Handle Windows drive letter\n let prefix = \"\"\n if (p.length >= 2 && p[1] === \":\") {\n prefix = p.slice(0, 2)\n p = p.slice(2)\n }\n\n // Replace backslashes with forward slashes for processing\n const isWin = p.includes(\"\\\\\")\n p = p.replace(/\\\\/g, \"/\")\n\n // Split and process\n const isAbsolute = p.startsWith(\"/\")\n const parts = p.split(\"/\").filter((part) => part && part !== \".\")\n const result: string[] = []\n\n for (const part of parts) {\n if (part === \"..\") {\n if (result.length > 0 && result[result.length - 1] !== \"..\") {\n result.pop()\n } else if (!isAbsolute) {\n result.push(\"..\")\n }\n } else {\n result.push(part)\n }\n }\n\n let normalized = result.join(isWin ? \"\\\\\" : \"/\")\n if (isAbsolute) {\n normalized = (isWin ? \"\\\\\" : \"/\") + normalized\n }\n normalized = prefix + normalized\n\n return normalized || \".\"\n },\n\n /** Return normalized absolutized version of pathname */\n abspath(p: string): string {\n if (path.isabs(p)) {\n return path.normpath(p)\n }\n // In browser, we can't get cwd, so just normalize\n return path.normpath(p)\n },\n\n /** Return canonical path, eliminating symlinks (stub - just normalizes) */\n realpath(p: string): string {\n return path.abspath(p)\n },\n\n /** Return relative path from start to path */\n relpath(p: string, start: string = \".\"): string {\n const pParts = path.normpath(p).split(/[/\\\\]/).filter(Boolean)\n const startParts = path.normpath(start).split(/[/\\\\]/).filter(Boolean)\n\n // Find common prefix length\n let commonLen = 0\n const minLen = Math.min(pParts.length, startParts.length)\n for (let i = 0; i < minLen; i++) {\n if (pParts[i] === startParts[i]) {\n commonLen++\n } else {\n break\n }\n }\n\n // Build relative path\n const upCount = startParts.length - commonLen\n const result = [...Array<string>(upCount).fill(\"..\"), ...pParts.slice(commonLen)]\n return result.join(sep) || \".\"\n },\n\n /** Return common path prefix */\n commonpath(paths: string[]): string {\n if (paths.length === 0) {\n throw new Error(\"commonpath() arg is an empty sequence\")\n }\n\n const splitPaths = paths.map((p) => path.normpath(p).split(/[/\\\\]/))\n const first = splitPaths[0] as string[]\n let commonLen = first.length\n\n for (let i = 1; i < splitPaths.length; i++) {\n const parts = splitPaths[i] as string[]\n commonLen = Math.min(commonLen, parts.length)\n for (let j = 0; j < commonLen; j++) {\n if (parts[j] !== first[j]) {\n commonLen = j\n break\n }\n }\n }\n\n return first.slice(0, commonLen).join(sep) || sep\n },\n\n /** Expand ~ and ~user (stub - returns unchanged in browser) */\n expanduser(p: string): string {\n if (!p.startsWith(\"~\")) return p\n const home =\n typeof process !== \"undefined\" ? (process.env.HOME ?? process.env.USERPROFILE) : undefined\n if (!home) return p\n if (p === \"~\" || p.startsWith(\"~/\") || p.startsWith(\"~\\\\\")) {\n return home + p.slice(1)\n }\n return p\n },\n\n /** Expand shell variables (stub - returns unchanged) */\n expandvars(p: string): string {\n // Simple $VAR and ${VAR} expansion\n return p.replace(/\\$(\\w+)|\\$\\{(\\w+)\\}/g, (_, v1: string, v2: string) => {\n const key = v1 || v2\n return environ[key] ?? \"\"\n })\n },\n\n /* eslint-disable @typescript-eslint/no-unused-vars */\n /** Test if path exists (stub - always returns false in browser) */\n exists(_p: string): boolean {\n return false\n },\n\n /** Test if path is a file (stub - always returns false in browser) */\n isfile(_p: string): boolean {\n return false\n },\n\n /** Test if path is a directory (stub - always returns false in browser) */\n isdir(_p: string): boolean {\n return false\n },\n\n /** Test if path is a symbolic link (stub - always returns false in browser) */\n islink(_p: string): boolean {\n return false\n },\n\n /** Return size of file (stub - returns 0 in browser) */\n getsize(_p: string): number {\n return 0\n },\n\n /** Return modification time (stub - returns 0 in browser) */\n getmtime(_p: string): number {\n return 0\n },\n\n /** Return access time (stub - returns 0 in browser) */\n getatime(_p: string): number {\n return 0\n },\n\n /** Return creation time (stub - returns 0 in browser) */\n getctime(_p: string): number {\n return 0\n }\n /* eslint-enable @typescript-eslint/no-unused-vars */\n}\n\n// ============================================================================\n// Process functions (stubs for browser compatibility)\n// ============================================================================\n\n/** Get current working directory */\nexport function getcwd(): string {\n if (typeof process !== \"undefined\") {\n return process.cwd()\n }\n return \"/\"\n}\n\n/** Get current working directory as bytes (same as getcwd in TS) */\nexport function getcwdb(): string {\n return getcwd()\n}\n\n/** Change current working directory (stub in browser) */\nexport function chdir(p: string): void {\n if (typeof process !== \"undefined\") {\n process.chdir(p)\n }\n}\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/** List directory contents (stub - returns empty array in browser) */\nexport function listdir(_p: string = \".\"): string[] {\n return []\n}\n\n/** Create a directory (stub in browser) */\nexport function mkdir(_p: string, _mode: number = 0o777): void {\n // No-op in browser\n}\n\n/** Create a directory and parents (stub in browser) */\nexport function makedirs(_p: string, _mode: number = 0o777, _existOk: boolean = false): void {\n // No-op in browser\n}\n\n/** Remove a file (stub in browser) */\nexport function remove(_p: string): void {\n // No-op in browser\n}\n\n/** Remove a file (alias for remove) */\nexport const unlink = remove\n\n/** Remove a directory (stub in browser) */\nexport function rmdir(_p: string): void {\n // No-op in browser\n}\n\n/** Remove directory tree (stub in browser) */\nexport function removedirs(_p: string): void {\n // No-op in browser\n}\n\n/** Rename a file or directory (stub in browser) */\nexport function rename(_src: string, _dst: string): void {\n // No-op in browser\n}\n\n/** Rename with automatic directory creation (stub in browser) */\nexport function renames(_src: string, _dst: string): void {\n // No-op in browser\n}\n\n/** Replace file (stub in browser) */\nexport function replace(_src: string, _dst: string): void {\n // No-op in browser\n}\n\n/** Walk directory tree (stub - yields nothing in browser) */\nexport function* walk(\n _top: string,\n _options?: { topdown?: boolean; followlinks?: boolean }\n): Generator<[string, string[], string[]]> {\n // No-op in browser\n}\n\n/** Get file stat (stub in browser) */\nexport function stat(_p: string): {\n st_mode: number\n st_size: number\n st_mtime: number\n st_atime: number\n st_ctime: number\n} {\n return { st_mode: 0, st_size: 0, st_mtime: 0, st_atime: 0, st_ctime: 0 }\n}\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\n// ============================================================================\n// Name and platform info\n// ============================================================================\n\n/** Operating system name */\nexport const name: string =\n typeof process !== \"undefined\" && process.platform === \"win32\" ? \"nt\" : \"posix\"\n"],"mappings":";;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYO,IAAM,UACX,OAAO,YAAY,cAAc,QAAQ,MAAM,CAAC;AAG3C,SAAS,OAAO,KAAa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