@hologit/holo-tree 0.3.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.
Files changed (2) hide show
  1. package/index.d.ts +9 -0
  2. package/package.json +7 -7
package/index.d.ts CHANGED
@@ -123,6 +123,15 @@ export declare class Tree {
123
123
  writeChild(path: string, content: string): string
124
124
  /** Hash raw bytes as a blob and insert at `path`. Binary-safe. */
125
125
  writeChildBytes(path: string, content: Buffer): string
126
+ /**
127
+ * Place an already-written blob at `path` by its `hash`, without reading its
128
+ * bytes. Unlike `writeChildBytes` (which re-hashes content), this grafts a
129
+ * blob already in the ODB — validated to exist and be a blob via a header
130
+ * lookup, so a large attachment isn't read back and re-hashed. `mode` is the
131
+ * git filemode: `0o100644` regular, `0o100755` executable, `0o120000`
132
+ * symlink. Returns the placed hash.
133
+ */
134
+ writeChildHash(path: string, hash: string, mode: number): string
126
135
  /** Read a blob's bytes at `path`, or `null` if no blob exists there. */
127
136
  readBlob(path: string): Buffer | null
128
137
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hologit/holo-tree",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Node.js native binding for holo-tree — mutable in-memory git trees via gix",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -32,12 +32,12 @@
32
32
  "index.d.ts"
33
33
  ],
34
34
  "optionalDependencies": {
35
- "@hologit/holo-tree-linux-x64-gnu": "0.3.0",
36
- "@hologit/holo-tree-linux-arm64-gnu": "0.3.0",
37
- "@hologit/holo-tree-linux-x64-musl": "0.3.0",
38
- "@hologit/holo-tree-darwin-arm64": "0.3.0",
39
- "@hologit/holo-tree-darwin-x64": "0.3.0",
40
- "@hologit/holo-tree-win32-x64-msvc": "0.3.0"
35
+ "@hologit/holo-tree-linux-x64-gnu": "0.4.0",
36
+ "@hologit/holo-tree-linux-arm64-gnu": "0.4.0",
37
+ "@hologit/holo-tree-linux-x64-musl": "0.4.0",
38
+ "@hologit/holo-tree-darwin-arm64": "0.4.0",
39
+ "@hologit/holo-tree-darwin-x64": "0.4.0",
40
+ "@hologit/holo-tree-win32-x64-msvc": "0.4.0"
41
41
  },
42
42
  "scripts": {
43
43
  "artifacts": "napi artifacts",