@effected/jsonl 0.4.0 → 0.5.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/internal/tail.js +4 -4
- package/package.json +2 -2
- package/tsdoc-metadata.json +1 -1
package/internal/tail.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Effect, Option } from "effect";
|
|
1
|
+
import { ByteSize, Effect, Option } from "effect";
|
|
2
2
|
|
|
3
3
|
//#region src/internal/tail.ts
|
|
4
4
|
/** UTF-8 BOM, as bytes. `U+FEFF` encodes to these three. */
|
|
@@ -66,11 +66,11 @@ const probeBomBytes = (fs, path) => Effect.gen(function* () {
|
|
|
66
66
|
*/
|
|
67
67
|
const readTail = (fs, path, window, bomBytes) => Effect.gen(function* () {
|
|
68
68
|
const info = yield* fs.stat(path);
|
|
69
|
-
const physicalSize =
|
|
69
|
+
const physicalSize = ByteSize.toNumberUnsafe(info.size);
|
|
70
70
|
const logicalSize = physicalSize - bomBytes;
|
|
71
71
|
const from = Math.max(bomBytes, physicalSize - window);
|
|
72
72
|
const file = yield* fs.open(path, { flag: "r" });
|
|
73
|
-
yield* file.seek(from, "start");
|
|
73
|
+
yield* file.seek(BigInt(from), "start");
|
|
74
74
|
const read = yield* file.readAlloc(physicalSize - from);
|
|
75
75
|
const bytes = Option.getOrElse(read, () => /* @__PURE__ */ new Uint8Array(0));
|
|
76
76
|
const windowAtFileStart = from === bomBytes;
|
|
@@ -124,7 +124,7 @@ const readTailUntil = (fs, path, bomBytes, decode, initialWindow = DEFAULT_WINDO
|
|
|
124
124
|
const readRangeText = (fs, path, from, length) => Effect.gen(function* () {
|
|
125
125
|
if (length <= 0) return "";
|
|
126
126
|
const file = yield* fs.open(path, { flag: "r" });
|
|
127
|
-
yield* file.seek(from, "start");
|
|
127
|
+
yield* file.seek(BigInt(from), "start");
|
|
128
128
|
const decoder = new TextDecoder();
|
|
129
129
|
let text = "";
|
|
130
130
|
let remaining = length;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effected/jsonl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Append-only, schema-validated JSONL journals as a definable Effect service.",
|
|
6
6
|
"keywords": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"./package.json": "./package.json"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"effect": "4.0.0-rc.
|
|
40
|
+
"effect": "4.0.0-rc.115"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=24.11.0"
|