Merge two lockfiles, preferring entries from the newer lockfile.
Used for workspace scenarios where multiple package.json files
produce separate lockfiles that need to be combined.
Summary
Functions
Find packages that differ between two lockfiles.
Merge two lockfiles. Entries in newer override entries in base.
Merge with a custom conflict resolver.
Functions
@spec diff(NPM.Lockfile.t(), NPM.Lockfile.t()) :: {[String.t()], [String.t()], [{String.t(), String.t(), String.t()}]}
Find packages that differ between two lockfiles.
Returns {added, removed, changed} where:
added— packages innewerbut notbaseremoved— packages inbasebut notnewerchanged— packages in both with different versions
@spec merge(NPM.Lockfile.t(), NPM.Lockfile.t()) :: NPM.Lockfile.t()
Merge two lockfiles. Entries in newer override entries in base.
Returns the merged lockfile map.
@spec merge(NPM.Lockfile.t(), NPM.Lockfile.t(), function()) :: NPM.Lockfile.t()
Merge with a custom conflict resolver.
The resolver function receives (name, base_entry, newer_entry)
and returns the winning entry.