json-conflict-resolver
Version:
A rules-based JSON conflict resolver that parses Git conflict markers, reconstructs ours/theirs, and merges with deterministic strategies — beyond line-based merges.
2 lines (1 loc) • 658 B
JavaScript
import{a as u}from"./chunk-2SJFRDGH.mjs";import{b as l}from"./chunk-Q4E7EFS7.mjs";import{a as p}from"./chunk-ICS3PEIS.mjs";import{h as f}from"./chunk-HB6Q755Y.mjs";import{a as m}from"./chunk-AUIVUOKV.mjs";var x=async r=>{let e=await p(r.loggerConfig,r.debug),o=await l(r),C=await f(o);await Promise.all(C.map(async({filePath:t,content:c})=>{var g;let{theirs:i,ours:a,base:s,format:n}=await m(c,{filename:t,parsers:o.parsers});e.debug(t,JSON.stringify({ours:a,theirs:i,base:s,format:n},null,2)),await u({ours:a,theirs:i,base:s,format:n,filePath:t,config:r,normalizedConfig:o,logger:e,autoStage:(g=o.autoStage)!=null?g:!0})})),await e.flush()};export{x as a};