@oh-my-pi/hashline 18.0.3 → 18.0.4

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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [18.0.4] - 2026-08-24
6
+
7
+ ### Changed
8
+
9
+ - Improved line-ending normalization performance by avoiding full scan-and-copy operations on files without carriage returns, eliminating stalls on large LF-only files.
10
+
5
11
  ## [17.4.0] - 2026-08-20
6
12
 
7
13
  ### Added
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/hashline",
4
- "version": "18.0.3",
4
+ "version": "18.0.4",
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": "Stencil Labs, Inc.",
@@ -33,8 +33,8 @@
33
33
  "fmt": "biome format --write ."
34
34
  },
35
35
  "dependencies": {
36
- "@oh-my-pi/pi-natives": "18.0.3",
37
- "@oh-my-pi/pi-utils": "18.0.3"
36
+ "@oh-my-pi/pi-natives": "18.0.4",
37
+ "@oh-my-pi/pi-utils": "18.0.4"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/bun": "^1.3.14"
package/src/normalize.ts CHANGED
@@ -17,7 +17,9 @@ export function detectLineEnding(content: string): LineEnding {
17
17
 
18
18
  /** Normalize every line ending to LF. */
19
19
  export function normalizeToLF(text: string): string {
20
- return text.replace(/\r\n?/g, "\n");
20
+ // Fast path: the regex pass allocates and costs ~2.5ms/MB even when there is
21
+ // nothing to replace; most real files are already LF-only.
22
+ return text.indexOf("\r") === -1 ? text : text.replace(/\r\n?/g, "\n");
21
23
  }
22
24
 
23
25
  /** Re-encode LF text with the requested line ending. */