diff
Everything exported by guardlink/diff, from the .d.ts files published in guardlink@2.0.0. See the entry points for the other subpaths, and use guardlink as a library for worked examples.
Interfaces
Section titled “Interfaces”DiffOptions
Section titled “DiffOptions”GuardLink Diff — exports.
Exposes
Section titled “Exposes”#diff to #cmd-injection [high] cwe:CWE-78 – “git.ts uses execSync with ref argument”
#diff – “Git commands use execSync; ref is validated with rev-parse before use”
GitRef -> #diff via parseAtRef – “Git reference input”
Properties
Section titled “Properties”StaleEntitlement
Section titled “StaleEntitlement”GuardLink Diff — exports.
Exposes
Section titled “Exposes”#diff to #cmd-injection [high] cwe:CWE-78 – “git.ts uses execSync with ref argument”
#diff – “Git commands use execSync; ref is validated with rev-parse before use”
GitRef -> #diff via parseAtRef – “Git reference input”
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
citedFile |
string |
The changed file that the entitlement’s citation points at |
entitlement |
ThreatModelEntitlement |
- |
Functions
Section titled “Functions”getChangedFiles()
Section titled “getChangedFiles()”getChangedFiles(
root,ref):string[]
List files that changed between ref and the working tree, repo-relative.
Feeds diffModels({ changedFiles }) so an
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
root |
string |
ref |
string |
Returns
Section titled “Returns”string[]
Entitles
Section titled “Entitles”whose cited authorization code moved is reported as stale (actor-entitlement design §3.7). Returns [] on any git failure — staleness is advisory, and a diff that cannot resolve the ref should still report the rest of the delta.
Exposes
Section titled “Exposes”#diff to #cmd-injection [high] cwe:CWE-78 – “ref is interpolated into an execSync git command”
Mitigates
Section titled “Mitigates”#diff against #cmd-injection using #input-sanitize – “rev-parse –verify must resolve ref to a single revision before it reaches the diff command; a shell metacharacter makes rev-parse fail, so the function returns [] instead of running the second command”
GitRef -> #diff via execSync – “Ref input to git diff –name-only”
#diff -> ChangedFileList via return – “Repo-relative paths used for entitlement staleness”
getCurrentRef()
Section titled “getCurrentRef()”getCurrentRef(
root):string
Get the current HEAD commit hash (short).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
root |
string |
Returns
Section titled “Returns”string
References
Section titled “References”Change
Section titled “Change”Re-exports Change
ChangeKind
Section titled “ChangeKind”Re-exports ChangeKind
diffModels
Section titled “diffModels”Re-exports diffModels
DiffSummary
Section titled “DiffSummary”Re-exports DiffSummary
formatDiff
Section titled “formatDiff”Re-exports formatDiff
formatDiffMarkdown
Section titled “formatDiffMarkdown”Re-exports formatDiffMarkdown
parseAtRef
Section titled “parseAtRef”Re-exports parseAtRef
ThreatModelDiff
Section titled “ThreatModelDiff”Re-exports ThreatModelDiff

