@oh-my-pi/hashline 17.2.7 → 17.2.9
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/package.json +2 -2
- package/src/fs.ts +8 -8
- package/src/snapshots.ts +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/hashline",
|
|
4
|
-
"version": "17.2.
|
|
4
|
+
"version": "17.2.9",
|
|
5
5
|
"description": "Hashline: a compact, line-anchored patch language and applier. Pluggable FS/IO so it works over disk, in-memory, or any custom backend.",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"fmt": "biome format --write ."
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@oh-my-pi/pi-natives": "17.2.
|
|
36
|
+
"@oh-my-pi/pi-natives": "17.2.9",
|
|
37
37
|
"lru-cache": "11.5.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
package/src/fs.ts
CHANGED
|
@@ -150,11 +150,11 @@ export class InMemoryFilesystem extends Filesystem {
|
|
|
150
150
|
return { text: content };
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
async delete(path: string): Promise<void> {
|
|
153
|
+
override async delete(path: string): Promise<void> {
|
|
154
154
|
if (!this.#files.delete(path)) throw new NotFoundError(path);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
async move(from: string, to: string, content?: string): Promise<void> {
|
|
157
|
+
override async move(from: string, to: string, content?: string): Promise<void> {
|
|
158
158
|
const existing = this.#files.get(from);
|
|
159
159
|
if (existing === undefined) throw new NotFoundError(from);
|
|
160
160
|
const finalContent = content ?? existing;
|
|
@@ -162,7 +162,7 @@ export class InMemoryFilesystem extends Filesystem {
|
|
|
162
162
|
this.#files.delete(from);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
async exists(path: string): Promise<boolean> {
|
|
165
|
+
override async exists(path: string): Promise<boolean> {
|
|
166
166
|
return this.#files.has(path);
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -199,7 +199,7 @@ export class NodeFilesystem extends Filesystem {
|
|
|
199
199
|
return file.text();
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
async readBinary(path: string): Promise<Uint8Array> {
|
|
202
|
+
override async readBinary(path: string): Promise<Uint8Array> {
|
|
203
203
|
try {
|
|
204
204
|
return await fs.readFile(path);
|
|
205
205
|
} catch (error) {
|
|
@@ -213,7 +213,7 @@ export class NodeFilesystem extends Filesystem {
|
|
|
213
213
|
return { text: content };
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
async delete(path: string): Promise<void> {
|
|
216
|
+
override async delete(path: string): Promise<void> {
|
|
217
217
|
try {
|
|
218
218
|
await fs.rm(path);
|
|
219
219
|
} catch (error) {
|
|
@@ -222,7 +222,7 @@ export class NodeFilesystem extends Filesystem {
|
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
async move(from: string, to: string, content?: string): Promise<void> {
|
|
225
|
+
override async move(from: string, to: string, content?: string): Promise<void> {
|
|
226
226
|
if (content !== undefined) {
|
|
227
227
|
await Bun.write(to, content);
|
|
228
228
|
await this.delete(from);
|
|
@@ -236,11 +236,11 @@ export class NodeFilesystem extends Filesystem {
|
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
canonicalPath(path: string): string {
|
|
239
|
+
override canonicalPath(path: string): string {
|
|
240
240
|
return pathModule.resolve(path);
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
async exists(path: string): Promise<boolean> {
|
|
243
|
+
override async exists(path: string): Promise<boolean> {
|
|
244
244
|
return Bun.file(path).exists();
|
|
245
245
|
}
|
|
246
246
|
}
|
package/src/snapshots.ts
CHANGED
|
@@ -180,7 +180,7 @@ export class InMemorySnapshotStore extends SnapshotStore {
|
|
|
180
180
|
return history?.find(version => version.text === fullText) ?? null;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
findByHash(hash: string): Snapshot[] {
|
|
183
|
+
override findByHash(hash: string): Snapshot[] {
|
|
184
184
|
const matches: Snapshot[] = [];
|
|
185
185
|
for (const history of this.#versions.values()) {
|
|
186
186
|
for (const version of history) {
|