@opencode/util 2.2.0 → 2.2.2
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/fs-util.js +1 -1
- package/dist/path.js +4 -0
- package/package.json +5 -5
package/dist/fs-util.js
CHANGED
|
@@ -57,7 +57,7 @@ export var FSUtil;
|
|
|
57
57
|
const resolve = Effect.fn("FileSystem.resolve")(function* (input) {
|
|
58
58
|
const resolved = path.resolve(windowsPath(input));
|
|
59
59
|
// Sandboxes deny reads outside granted paths; canonicalize what we can see.
|
|
60
|
-
return yield* fs.realPath(resolved).pipe(Effect.catchIf((error) => error.reason._tag === "NotFound" || isAccessDenied(error), () => Effect.succeed(resolved)), Effect.orDie);
|
|
60
|
+
return yield* fs.realPath(resolved).pipe(Effect.map((real) => process.platform === "win32" && real.toLowerCase() === resolved.toLowerCase() ? resolved : real), Effect.catchIf((error) => error.reason._tag === "NotFound" || isAccessDenied(error), () => Effect.succeed(resolved)), Effect.orDie);
|
|
61
61
|
});
|
|
62
62
|
const readJson = Effect.fn("FileSystem.readJson")(function* (path) {
|
|
63
63
|
const text = yield* fs.readFileString(path);
|
package/dist/path.js
CHANGED
|
@@ -24,11 +24,15 @@ export function getFilenameTruncated(path, maxLength = 20) {
|
|
|
24
24
|
return filename.slice(0, available) + "…" + extension;
|
|
25
25
|
}
|
|
26
26
|
export function truncateMiddle(text, maxLength = 20) {
|
|
27
|
+
if (maxLength <= 0)
|
|
28
|
+
return "";
|
|
27
29
|
if (text.length <= maxLength)
|
|
28
30
|
return text;
|
|
29
31
|
const available = maxLength - 1;
|
|
30
32
|
const start = Math.ceil(available / 2);
|
|
31
33
|
const end = Math.floor(available / 2);
|
|
34
|
+
if (end <= 0)
|
|
35
|
+
return text.slice(0, start) + "…";
|
|
32
36
|
return text.slice(0, start) + "…" + text.slice(-end);
|
|
33
37
|
}
|
|
34
38
|
const isDrive = (value) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode/util",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"typecheck:dist": "bun run build && bun typecheck --project tsconfig.dist.json"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@effect/opentelemetry": "4.0.
|
|
50
|
-
"@effect/platform-node": "4.0.
|
|
51
|
-
"@effect/platform-node-shared": "4.0.
|
|
49
|
+
"@effect/opentelemetry": "4.0.6",
|
|
50
|
+
"@effect/platform-node": "4.0.6",
|
|
51
|
+
"@effect/platform-node-shared": "4.0.6",
|
|
52
52
|
"@npmcli/arborist": "9.4.0",
|
|
53
53
|
"@npmcli/config": "10.8.1",
|
|
54
54
|
"@opentelemetry/api": "1.9.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@opentelemetry/sdk-trace-base": "2.8.0",
|
|
62
62
|
"@opentelemetry/sdk-trace-node": "2.8.0",
|
|
63
63
|
"cross-spawn": "7.0.6",
|
|
64
|
-
"effect": "4.0.
|
|
64
|
+
"effect": "4.0.6",
|
|
65
65
|
"glob": "13.0.5",
|
|
66
66
|
"mime-types": "3.0.2",
|
|
67
67
|
"minimatch": "10.2.5",
|