@lifo-sh/core 0.2.0 → 0.4.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/dist/awk-CI8X5kVy.js +123 -0
- package/dist/{basename-C2v8jn7p.js → basename-D8VowKZK.js} +1 -1
- package/dist/{cat-B2exoWlk.js → cat-BPj_LHfi.js} +1 -1
- package/dist/{chmod-CQS63aP7.js → chmod-pNQSdBnq.js} +1 -1
- package/dist/{chown-rgGwZwu9.js → chown-BzpeyVqg.js} +1 -1
- package/dist/commands/system/lifo.d.ts +11 -0
- package/dist/commands/system/lifo.d.ts.map +1 -0
- package/dist/commands/system/node.d.ts.map +1 -1
- package/dist/commands/system/npm.d.ts +5 -0
- package/dist/commands/system/npm.d.ts.map +1 -0
- package/dist/commands/text/awk.d.ts.map +1 -1
- package/dist/commands/text/cut.d.ts.map +1 -1
- package/dist/commands/text/diff.d.ts.map +1 -1
- package/dist/commands/text/grep.d.ts.map +1 -1
- package/dist/commands/text/head.d.ts.map +1 -1
- package/dist/commands/text/nl.d.ts.map +1 -1
- package/dist/commands/text/rev.d.ts.map +1 -1
- package/dist/commands/text/sed.d.ts.map +1 -1
- package/dist/commands/text/sort.d.ts.map +1 -1
- package/dist/commands/text/tail.d.ts.map +1 -1
- package/dist/commands/text/uniq.d.ts.map +1 -1
- package/dist/commands/text/wc.d.ts.map +1 -1
- package/dist/{cp-C8mNek36.js → cp-_rhci8W9.js} +1 -1
- package/dist/cut-Q5nQyrUo.js +65 -0
- package/dist/diff-Dvc96Xgm.js +150 -0
- package/dist/{dirname-BY_Gu5i2.js → dirname-B9Rm-O9I.js} +1 -1
- package/dist/{du-D25egSeK.js → du-Cv4zAsqm.js} +1 -1
- package/dist/{file-BPs1dqg5.js → file-Cxgmm1Vo.js} +1 -1
- package/dist/{find-CRUAXbhO.js → find-BJNOna6S.js} +1 -1
- package/dist/{grep-B9pTCSNY.js → grep-vdjjGK6g.js} +33 -26
- package/dist/gunzip-AmY9PUj2.js +47 -0
- package/dist/{gzip-DgE-9PzE.js → gzip-C_08tX3p.js} +4 -5
- package/dist/head-DGXxKqPE.js +53 -0
- package/dist/index-CvsPTm3-.js +8450 -0
- package/dist/index.d.ts +17 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +69 -44
- package/dist/kernel/index.d.ts +2 -1
- package/dist/kernel/index.d.ts.map +1 -1
- package/dist/kernel/persistence/PersistenceManager.d.ts +3 -1
- package/dist/kernel/persistence/PersistenceManager.d.ts.map +1 -1
- package/dist/kernel/persistence/backends.d.ts +22 -0
- package/dist/kernel/persistence/backends.d.ts.map +1 -0
- package/dist/kernel/persistence/index.d.ts +6 -0
- package/dist/kernel/persistence/index.d.ts.map +1 -0
- package/dist/kernel/persistence/serializer.d.ts +8 -0
- package/dist/kernel/persistence/serializer.d.ts.map +1 -1
- package/dist/kernel/storage/BlobStore.d.ts +31 -0
- package/dist/kernel/storage/BlobStore.d.ts.map +1 -0
- package/dist/kernel/storage/ContentStore.d.ts +52 -0
- package/dist/kernel/storage/ContentStore.d.ts.map +1 -0
- package/dist/kernel/storage/index.d.ts +7 -0
- package/dist/kernel/storage/index.d.ts.map +1 -0
- package/dist/kernel/vfs/VFS.d.ts +31 -3
- package/dist/kernel/vfs/VFS.d.ts.map +1 -1
- package/dist/kernel/vfs/index.d.ts +4 -1
- package/dist/kernel/vfs/index.d.ts.map +1 -1
- package/dist/kernel/vfs/providers/NativeFsProvider.d.ts +63 -0
- package/dist/kernel/vfs/providers/NativeFsProvider.d.ts.map +1 -0
- package/dist/kernel/vfs/types.d.ts +27 -0
- package/dist/kernel/vfs/types.d.ts.map +1 -1
- package/dist/{ls-BiT10kLm.js → ls-BOMe19Ls.js} +1 -1
- package/dist/{mkdir-DgzJ2JLj.js → mkdir-DE5ZBdl1.js} +1 -1
- package/dist/{mktemp-Sh5DWxvc.js → mktemp-De1K5WCb.js} +1 -1
- package/dist/{mv-Kp6DjQ8n.js → mv-Cw8pg9wR.js} +1 -1
- package/dist/{nl-DBLFdpfC.js → nl-C-osPl2N.js} +13 -10
- package/dist/node-compat/buffer.d.ts +29 -2
- package/dist/node-compat/buffer.d.ts.map +1 -1
- package/dist/node-compat/fs.d.ts +62 -0
- package/dist/node-compat/fs.d.ts.map +1 -1
- package/dist/node-compat/index.d.ts.map +1 -1
- package/dist/node-compat/string_decoder.d.ts +11 -0
- package/dist/node-compat/string_decoder.d.ts.map +1 -0
- package/dist/node-compat/zlib.d.ts +66 -0
- package/dist/node-compat/zlib.d.ts.map +1 -0
- package/dist/pkg/lifo-dev.d.ts +32 -0
- package/dist/pkg/lifo-dev.d.ts.map +1 -0
- package/dist/pkg/lifo-runtime.d.ts +35 -0
- package/dist/pkg/lifo-runtime.d.ts.map +1 -0
- package/dist/{realpath-BOeYN6nD.js → realpath-BSWdZLjf.js} +1 -1
- package/dist/rev-3C5MtCkc.js +39 -0
- package/dist/{rm-DA2w3xTR.js → rm-CR560cHz.js} +1 -1
- package/dist/{rmdir-BiGbNDOT.js → rmdir-BO4Jz3r5.js} +3 -3
- package/dist/sandbox/Sandbox.d.ts +31 -0
- package/dist/sandbox/Sandbox.d.ts.map +1 -1
- package/dist/sandbox/SandboxFs.d.ts +4 -0
- package/dist/sandbox/SandboxFs.d.ts.map +1 -1
- package/dist/sandbox/types.d.ts +19 -0
- package/dist/sandbox/types.d.ts.map +1 -1
- package/dist/sed-DCUgJWcA.js +95 -0
- package/dist/{sort-CSzSGTdB.js → sort-or-F_iEY.js} +19 -14
- package/dist/{stat-D0i1gTKB.js → stat-MGHvbiS7.js} +1 -1
- package/dist/tail-DheqHGe2.js +52 -0
- package/dist/{tar-DkyzTzmT.js → tar-DhLtWtBV.js} +15 -16
- package/dist/{tee-RqoZ3qG-.js → tee-D47GOzfR.js} +1 -1
- package/dist/{touch-k2NomRzL.js → touch-D7Xd2vNM.js} +1 -1
- package/dist/{tree-B_j2_PsZ.js → tree-CRpLFDhe.js} +1 -1
- package/dist/uniq-DwHCe--v.js +54 -0
- package/dist/{unzip-FwYCTDEZ.js → unzip-DPEg74Aq.js} +18 -19
- package/dist/utils/mime.d.ts +4 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/wc-BUIoLfSN.js +69 -0
- package/dist/{wget-2NAABIHc.js → wget-BwmpusXQ.js} +1 -1
- package/dist/{zip--0ncHv0q.js → zip-B4jRyQ7B.js} +11 -12
- package/package.json +10 -9
- package/dist/archive-nRHWNwjH.js +0 -192
- package/dist/awk-CchAsBzt.js +0 -118
- package/dist/cut-BZez9bS1.js +0 -60
- package/dist/diff-tWPvmikU.js +0 -129
- package/dist/gunzip-BYlJhPf7.js +0 -48
- package/dist/head-DzP_T5Wx.js +0 -48
- package/dist/index-DccAPaZF.js +0 -6010
- package/dist/rev-CWRUIXWp.js +0 -34
- package/dist/sed-ClWZ06zX.js +0 -90
- package/dist/tail-tcIJLQnB.js +0 -47
- package/dist/uniq-hzJnHQOm.js +0 -51
- package/dist/wc-Jp7nOops.js +0 -60
package/dist/rev-CWRUIXWp.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { r as i, V as a } from "./index-DccAPaZF.js";
|
|
2
|
-
function s(r) {
|
|
3
|
-
return r.split(`
|
|
4
|
-
`).map((n) => [...n].reverse().join("")).join(`
|
|
5
|
-
`);
|
|
6
|
-
}
|
|
7
|
-
const f = async (r) => {
|
|
8
|
-
if (r.args.length === 0) {
|
|
9
|
-
if (r.stdin) {
|
|
10
|
-
const t = await r.stdin.readAll();
|
|
11
|
-
return r.stdout.write(s(t)), 0;
|
|
12
|
-
}
|
|
13
|
-
return r.stderr.write(`rev: missing operand
|
|
14
|
-
`), 1;
|
|
15
|
-
}
|
|
16
|
-
let n = 0;
|
|
17
|
-
for (const t of r.args) {
|
|
18
|
-
const o = i(r.cwd, t);
|
|
19
|
-
try {
|
|
20
|
-
const e = r.vfs.readFileString(o);
|
|
21
|
-
r.stdout.write(s(e));
|
|
22
|
-
} catch (e) {
|
|
23
|
-
if (e instanceof a)
|
|
24
|
-
r.stderr.write(`rev: ${t}: ${e.message}
|
|
25
|
-
`), n = 1;
|
|
26
|
-
else
|
|
27
|
-
throw e;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return n;
|
|
31
|
-
};
|
|
32
|
-
export {
|
|
33
|
-
f as default
|
|
34
|
-
};
|
package/dist/sed-ClWZ06zX.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { r as c, V as g } from "./index-DccAPaZF.js";
|
|
2
|
-
function h(e) {
|
|
3
|
-
if (e === "d")
|
|
4
|
-
return { type: "d" };
|
|
5
|
-
if (e === "p")
|
|
6
|
-
return { type: "p" };
|
|
7
|
-
if (e.startsWith("s")) {
|
|
8
|
-
const u = e[1];
|
|
9
|
-
if (!u) return null;
|
|
10
|
-
const n = [];
|
|
11
|
-
let l = "", f = !1;
|
|
12
|
-
for (let r = 2; r < e.length; r++)
|
|
13
|
-
f ? (l += e[r], f = !1) : e[r] === "\\" ? (f = !0, l += "\\") : e[r] === u ? (n.push(l), l = "") : l += e[r];
|
|
14
|
-
if (n.push(l), n.length < 2) return null;
|
|
15
|
-
const p = n[0], d = n[1], t = n[2] || "", s = t.includes("g"), i = t.includes("i");
|
|
16
|
-
let o;
|
|
17
|
-
try {
|
|
18
|
-
let r = "";
|
|
19
|
-
s && (r += "g"), i && (r += "i"), o = new RegExp(p, r);
|
|
20
|
-
} catch {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
return { type: "s", pattern: o, replacement: d, global: s };
|
|
24
|
-
}
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
const w = async (e) => {
|
|
28
|
-
let u = !1;
|
|
29
|
-
const n = [], l = [];
|
|
30
|
-
for (let t = 0; t < e.args.length; t++) {
|
|
31
|
-
const s = e.args[t];
|
|
32
|
-
s === "-i" ? u = !0 : s === "-e" && t + 1 < e.args.length ? n.push(e.args[++t]) : n.length === 0 && !s.startsWith("-") ? n.push(s) : l.push(s);
|
|
33
|
-
}
|
|
34
|
-
if (n.length === 0)
|
|
35
|
-
return e.stderr.write(`sed: missing expression
|
|
36
|
-
`), 1;
|
|
37
|
-
const f = [];
|
|
38
|
-
for (const t of n) {
|
|
39
|
-
const s = h(t);
|
|
40
|
-
if (!s)
|
|
41
|
-
return e.stderr.write(`sed: invalid expression: ${t}
|
|
42
|
-
`), 1;
|
|
43
|
-
f.push(s);
|
|
44
|
-
}
|
|
45
|
-
function p(t) {
|
|
46
|
-
const s = t.replace(/\n$/, "").split(`
|
|
47
|
-
`), i = [];
|
|
48
|
-
for (let o of s) {
|
|
49
|
-
let r = !1;
|
|
50
|
-
for (const a of f)
|
|
51
|
-
if (a.type === "s" && a.pattern && a.replacement !== void 0)
|
|
52
|
-
o = o.replace(a.pattern, a.replacement);
|
|
53
|
-
else if (a.type === "d") {
|
|
54
|
-
r = !0;
|
|
55
|
-
break;
|
|
56
|
-
} else a.type === "p" && i.push(o);
|
|
57
|
-
r || i.push(o);
|
|
58
|
-
}
|
|
59
|
-
return i.join(`
|
|
60
|
-
`) + `
|
|
61
|
-
`;
|
|
62
|
-
}
|
|
63
|
-
if (l.length === 0) {
|
|
64
|
-
if (e.stdin) {
|
|
65
|
-
const t = await e.stdin.readAll();
|
|
66
|
-
e.stdout.write(p(t));
|
|
67
|
-
} else
|
|
68
|
-
return e.stderr.write(`sed: missing file operand
|
|
69
|
-
`), 1;
|
|
70
|
-
return 0;
|
|
71
|
-
}
|
|
72
|
-
let d = 0;
|
|
73
|
-
for (const t of l) {
|
|
74
|
-
const s = c(e.cwd, t);
|
|
75
|
-
try {
|
|
76
|
-
const i = e.vfs.readFileString(s), o = p(i);
|
|
77
|
-
u ? e.vfs.writeFile(s, o) : e.stdout.write(o);
|
|
78
|
-
} catch (i) {
|
|
79
|
-
if (i instanceof g)
|
|
80
|
-
e.stderr.write(`sed: ${t}: ${i.message}
|
|
81
|
-
`), d = 1;
|
|
82
|
-
else
|
|
83
|
-
throw i;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return d;
|
|
87
|
-
};
|
|
88
|
-
export {
|
|
89
|
-
w as default
|
|
90
|
-
};
|
package/dist/tail-tcIJLQnB.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { r as o, V as f } from "./index-DccAPaZF.js";
|
|
2
|
-
const g = async (e) => {
|
|
3
|
-
let r = 10;
|
|
4
|
-
const i = [];
|
|
5
|
-
for (let t = 0; t < e.args.length; t++) {
|
|
6
|
-
const s = e.args[t];
|
|
7
|
-
if (s === "-n" && t + 1 < e.args.length) {
|
|
8
|
-
if (r = parseInt(e.args[++t], 10), isNaN(r))
|
|
9
|
-
return e.stderr.write(`tail: invalid number of lines
|
|
10
|
-
`), 1;
|
|
11
|
-
} else /^-\d+$/.test(s) ? r = parseInt(s.slice(1), 10) : i.push(s);
|
|
12
|
-
}
|
|
13
|
-
async function a(t) {
|
|
14
|
-
const n = t.replace(/\n$/, "").split(`
|
|
15
|
-
`).slice(-r);
|
|
16
|
-
e.stdout.write(n.join(`
|
|
17
|
-
`) + `
|
|
18
|
-
`);
|
|
19
|
-
}
|
|
20
|
-
if (i.length === 0) {
|
|
21
|
-
if (e.stdin)
|
|
22
|
-
await a(await e.stdin.readAll());
|
|
23
|
-
else
|
|
24
|
-
return e.stderr.write(`tail: missing file operand
|
|
25
|
-
`), 1;
|
|
26
|
-
return 0;
|
|
27
|
-
}
|
|
28
|
-
let l = 0;
|
|
29
|
-
for (const t of i) {
|
|
30
|
-
const s = o(e.cwd, t);
|
|
31
|
-
try {
|
|
32
|
-
const n = e.vfs.readFileString(s);
|
|
33
|
-
i.length > 1 && e.stdout.write(`==> ${t} <==
|
|
34
|
-
`), await a(n);
|
|
35
|
-
} catch (n) {
|
|
36
|
-
if (n instanceof f)
|
|
37
|
-
e.stderr.write(`tail: ${t}: ${n.message}
|
|
38
|
-
`), l = 1;
|
|
39
|
-
else
|
|
40
|
-
throw n;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return l;
|
|
44
|
-
};
|
|
45
|
-
export {
|
|
46
|
-
g as default
|
|
47
|
-
};
|
package/dist/uniq-hzJnHQOm.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { r as f, V as c } from "./index-DccAPaZF.js";
|
|
2
|
-
const g = async (t) => {
|
|
3
|
-
let i = !1, l = !1, a = !1;
|
|
4
|
-
const r = [];
|
|
5
|
-
for (const e of t.args)
|
|
6
|
-
if (e.startsWith("-") && e.length > 1)
|
|
7
|
-
for (let s = 1; s < e.length; s++)
|
|
8
|
-
switch (e[s]) {
|
|
9
|
-
case "c":
|
|
10
|
-
i = !0;
|
|
11
|
-
break;
|
|
12
|
-
case "d":
|
|
13
|
-
l = !0;
|
|
14
|
-
break;
|
|
15
|
-
case "u":
|
|
16
|
-
a = !0;
|
|
17
|
-
break;
|
|
18
|
-
}
|
|
19
|
-
else
|
|
20
|
-
r.push(e);
|
|
21
|
-
let o = "";
|
|
22
|
-
if (r.length === 0)
|
|
23
|
-
if (t.stdin)
|
|
24
|
-
o = await t.stdin.readAll();
|
|
25
|
-
else
|
|
26
|
-
return t.stderr.write(`uniq: missing file operand
|
|
27
|
-
`), 1;
|
|
28
|
-
else {
|
|
29
|
-
const e = f(t.cwd, r[0]);
|
|
30
|
-
try {
|
|
31
|
-
o = t.vfs.readFileString(e);
|
|
32
|
-
} catch (s) {
|
|
33
|
-
if (s instanceof c)
|
|
34
|
-
return t.stderr.write(`uniq: ${r[0]}: ${s.message}
|
|
35
|
-
`), 1;
|
|
36
|
-
throw s;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
const u = o.replace(/\n$/, "").split(`
|
|
40
|
-
`), n = [];
|
|
41
|
-
for (const e of u)
|
|
42
|
-
n.length > 0 && n[n.length - 1].line === e ? n[n.length - 1].count++ : n.push({ line: e, count: 1 });
|
|
43
|
-
for (const e of n)
|
|
44
|
-
l && e.count < 2 || a && e.count > 1 || (i ? t.stdout.write(`${String(e.count).padStart(7)} ${e.line}
|
|
45
|
-
`) : t.stdout.write(e.line + `
|
|
46
|
-
`));
|
|
47
|
-
return 0;
|
|
48
|
-
};
|
|
49
|
-
export {
|
|
50
|
-
g as default
|
|
51
|
-
};
|
package/dist/wc-Jp7nOops.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { r as g, V as p } from "./index-DccAPaZF.js";
|
|
2
|
-
const y = async (r) => {
|
|
3
|
-
let o = !1, i = !1, l = !1;
|
|
4
|
-
const a = [];
|
|
5
|
-
for (const t of r.args)
|
|
6
|
-
if (t.startsWith("-") && t.length > 1)
|
|
7
|
-
for (let e = 1; e < t.length; e++)
|
|
8
|
-
switch (t[e]) {
|
|
9
|
-
case "l":
|
|
10
|
-
o = !0;
|
|
11
|
-
break;
|
|
12
|
-
case "w":
|
|
13
|
-
i = !0;
|
|
14
|
-
break;
|
|
15
|
-
case "c":
|
|
16
|
-
l = !0;
|
|
17
|
-
break;
|
|
18
|
-
}
|
|
19
|
-
else
|
|
20
|
-
a.push(t);
|
|
21
|
-
!o && !i && !l && (o = i = l = !0);
|
|
22
|
-
function d(t) {
|
|
23
|
-
const e = t === "" ? 0 : t.split(`
|
|
24
|
-
`).length - (t.endsWith(`
|
|
25
|
-
`) ? 1 : 0), s = t.trim() === "" ? 0 : t.trim().split(/\s+/).length, n = new TextEncoder().encode(t).length;
|
|
26
|
-
return { lines: e, words: s, bytes: n };
|
|
27
|
-
}
|
|
28
|
-
function f(t, e) {
|
|
29
|
-
const s = [];
|
|
30
|
-
return o && s.push(String(t.lines).padStart(8)), i && s.push(String(t.words).padStart(8)), l && s.push(String(t.bytes).padStart(8)), e && s.push(" " + e), s.join("") + `
|
|
31
|
-
`;
|
|
32
|
-
}
|
|
33
|
-
if (a.length === 0) {
|
|
34
|
-
if (r.stdin) {
|
|
35
|
-
const t = await r.stdin.readAll(), e = d(t);
|
|
36
|
-
r.stdout.write(f(e));
|
|
37
|
-
} else
|
|
38
|
-
return r.stderr.write(`wc: missing file operand
|
|
39
|
-
`), 1;
|
|
40
|
-
return 0;
|
|
41
|
-
}
|
|
42
|
-
let u = 0, c = 0, h = 0, w = 0;
|
|
43
|
-
for (const t of a) {
|
|
44
|
-
const e = g(r.cwd, t);
|
|
45
|
-
try {
|
|
46
|
-
const s = r.vfs.readFileString(e), n = d(s);
|
|
47
|
-
c += n.lines, h += n.words, w += n.bytes, r.stdout.write(f(n, t));
|
|
48
|
-
} catch (s) {
|
|
49
|
-
if (s instanceof p)
|
|
50
|
-
r.stderr.write(`wc: ${t}: ${s.message}
|
|
51
|
-
`), u = 1;
|
|
52
|
-
else
|
|
53
|
-
throw s;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return a.length > 1 && r.stdout.write(f({ lines: c, words: h, bytes: w }, "total")), u;
|
|
57
|
-
};
|
|
58
|
-
export {
|
|
59
|
-
y as default
|
|
60
|
-
};
|