Skip to main content

write_lockfile

Function write_lockfile 

Source
pub fn write_lockfile(lockfile: &Lockfile) -> String
Expand description

Render a lockfile to JSON.

Determinism guarantees:

  • Top-level keys: lockfileVersion, manifestHash, entries (in that order, fixed by the Lockfile struct’s field order).
  • entries map keys: alphabetical, courtesy of BTreeMap.
  • Each entry’s agents and dependencies arrays: alphabetical.
  • Trailing newline (POSIX-friendly diffs).