mejora 2.3.0 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/run.mjs +4 -4
- package/package.json +1 -1
package/dist/run.mjs
CHANGED
|
@@ -8,10 +8,10 @@ import{d as e,f as t,g as n,m as r,r as i,t as a,u as o}from"./typescript-C0a92m
|
|
|
8
8
|
}`.repeat(t)}`}function F(e){let t=(e.match(/\{/g)?.length??0)-(e.match(/\}/g)?.length??0);return t===0?e:t<0?N(e,-t):P(e,t)}function I(e){try{return JSON.parse(e)}catch{return}}function L(e){let t=e.trim();return t.endsWith(`,`)?t.slice(0,-1):t}function _e(e){return`{
|
|
9
9
|
"version": 2,
|
|
10
10
|
${L(e)}
|
|
11
|
-
}`}function R(e){if(typeof e!=`object`||!e)throw TypeError(`Baseline must be an object`);if(`checks`in e&&e.checks&&typeof e.checks==`object`)return{checks:e.checks,version:2};let t={};for(let[n,r]of Object.entries(e))n!==`version`&&(t[n]=r);return{checks:t,version:2}}function z(e){try{let t=I(e.trim());if(t)return R(t);let n=_e(F(L(e)));return R(JSON.parse(n))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to parse baseline during conflict resolution: ${t}`,{cause:e})}}function ve(e){let t=[...e.matchAll(/<<<<<<< .*\n([\s\S]*?)\n=======\n([\s\S]*?)\n>>>>>>> .*$/gm)];if(t.length===0)throw Error(`Could not parse conflict markers in baseline`);return t.map(([,e=``,t=``])=>({ours:e,theirs:t}))}function ye(e){let t=new Map;for(let n of e)for(let[e,{items:r=[]}]of Object.entries(n.checks)){if(r.length===0)continue;let n=t.get(e);n||(n=new Map,t.set(e,n));for(let e of r)n.set(e.id,e)}let n={};for(let[e,r]of t)n[e]={items:[...r.values()].toSorted((e,t)=>e.id.localeCompare(t.id)),type:`items`};return{checks:n,version:2}}function be(e){let t=ve(e),n=[];for(let{ours:e,theirs:r}of t)n.push(z(e),z(r));return ye(n)}const B=`__unparsable__`;function V(e){return e.replaceAll(`<`,`<`).replaceAll(`>`,`>`).replaceAll(`[`,`[`).replaceAll(`]`,`]`)}function H(e,t,n){let i=r(t,e);return n?`${i}#L${n}`:i}function U(e,t){return`[${e}](${t})`}function xe(e,t){let n=H(e.file,t,e.line);return`- ${U(e.line?`Line ${e.line}`:e.file,n)} - ${`${e.rule}: ${V(e.message)}`}`}function Se(e){let t=Object.groupBy(e,e=>e.file||B);return Object.entries(t).map(([e,t=[]])=>({filePath:e,items:t})).toSorted((e,t)=>e.filePath===B?1:t.filePath===B?-1:e.filePath.localeCompare(t.filePath))}function Ce(e){let
|
|
12
|
-
`)}function we(e,t){if(e.filePath===B)return Ce(e.items);let
|
|
13
|
-
`)}function Te(e,t,n){let r=t.length,i=[`\n## ${e}
|
|
14
|
-
`);let
|
|
11
|
+
}`}function R(e){if(typeof e!=`object`||!e)throw TypeError(`Baseline must be an object`);if(`checks`in e&&e.checks&&typeof e.checks==`object`)return{checks:e.checks,version:2};let t={};for(let[n,r]of Object.entries(e))n!==`version`&&(t[n]=r);return{checks:t,version:2}}function z(e){try{let t=I(e.trim());if(t)return R(t);let n=_e(F(L(e)));return R(JSON.parse(n))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to parse baseline during conflict resolution: ${t}`,{cause:e})}}function ve(e){let t=[...e.matchAll(/<<<<<<< .*\n([\s\S]*?)\n=======\n([\s\S]*?)\n>>>>>>> .*$/gm)];if(t.length===0)throw Error(`Could not parse conflict markers in baseline`);return t.map(([,e=``,t=``])=>({ours:e,theirs:t}))}function ye(e){let t=new Map;for(let n of e)for(let[e,{items:r=[]}]of Object.entries(n.checks)){if(r.length===0)continue;let n=t.get(e);n||(n=new Map,t.set(e,n));for(let e of r)n.set(e.id,e)}let n={};for(let[e,r]of t)n[e]={items:[...r.values()].toSorted((e,t)=>e.id.localeCompare(t.id)),type:`items`};return{checks:n,version:2}}function be(e){let t=ve(e),n=[];for(let{ours:e,theirs:r}of t)n.push(z(e),z(r));return ye(n)}const B=`__unparsable__`;function V(e){return e.replaceAll(`<`,`<`).replaceAll(`>`,`>`).replaceAll(`[`,`[`).replaceAll(`]`,`]`)}function H(e,t,n){let i=r(t,e);return n?`${i}#L${n}`:i}function U(e,t){return`[${e}](${t})`}function xe(e,t){let n=H(e.file,t,e.line);return`- ${U(e.line?`Line ${e.line}`:e.file,n)} - ${`${e.rule}: ${V(e.message)}`}`}function Se(e){let t=Object.groupBy(e,e=>e.file||B);return Object.entries(t).map(([e,t=[]])=>({filePath:e,items:t})).toSorted((e,t)=>e.filePath===B?1:t.filePath===B?-1:e.filePath.localeCompare(t.filePath))}function Ce(e,t){let n=e.length,r=E(n,`issue`),i=[`\n### Other Issues · ${t}\n`];for(let t of e)i.push(`- ${t.rule}: ${V(t.message)}`);return i.push(`\n${n} ${r} in Other Issues`,``),i.join(`
|
|
12
|
+
`)}function we(e,t,n){if(e.filePath===B)return Ce(e.items,n);let r=H(e.filePath,t),i=U(e.filePath,r),a=e.items.length,o=E(a,`issue`),s=[`\n### ${i} · ${n}\n`];for(let n of e.items)s.push(xe(n,t));return s.push(`\n${a} ${o} in ${e.filePath}`,``),s.join(`
|
|
13
|
+
`)}function Te(e,t,n){let r=t.length,i=E(r,`issue`),a=[`\n## ${e}\n`];if(t.length===0)return a.push(`No issues`),a.join(`
|
|
14
|
+
`);let o=Se(t);for(let t of o)a.push(we(t,n,e));return a.push(`---\n${r} total ${i} for ${e}`),a.join(`
|
|
15
15
|
`)}function Ee(e){return`${e.replaceAll(/\n{3,}/g,`
|
|
16
16
|
|
|
17
17
|
`).trimEnd()}\n`}function W(e,t){let n=[`<!-- prettier-ignore-start -->
|