UNPKG

json-merge-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
import{a as u}from"./chunk-QPL3HXPB.mjs";import{b as p}from"./chunk-XH3FBGBA.mjs";import{a as l}from"./chunk-7UWGXGKY.mjs";import{h as f}from"./chunk-HB6Q755Y.mjs";import{a as m}from"./chunk-54J6PE6E.mjs";var z=async e=>{let r=await l(e.loggerConfig,e.debug),t=await p(e),C=await f(t);await Promise.all(C.map(async({filePath:o,content:c})=>{var g;let{theirs:i,ours:a,base:s,format:n}=await m(c,{filename:o,parsers:t.parsers});r.debug(o,JSON.stringify({ours:a,theirs:i,base:s,format:n},null,2)),await u({ours:a,theirs:i,base:s,format:n,filePath:o,config:e,normalizedConfig:t,logger:r,autoStage:(g=t.autoStage)!=null?g:!0})})),await r.flush()};export{z as a};