@fuzzle/opencode-accountant 0.13.1-next.1 → 0.13.2-next.1

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -24463,7 +24463,9 @@ var INDENT = " ";
24463
24463
  function formatPostings(postings) {
24464
24464
  const maxAccountLen = postings.reduce((max, p) => Math.max(max, p.account.length), 0);
24465
24465
  return postings.map((p) => {
24466
- const gap = Math.max(MIN_GAP, maxAccountLen - p.account.length + MIN_GAP);
24466
+ const isNegative = p.amount.startsWith("-");
24467
+ const signOffset = isNegative ? 1 : 0;
24468
+ const gap = Math.max(MIN_GAP - signOffset, maxAccountLen - p.account.length + MIN_GAP - signOffset);
24467
24469
  const line = `${INDENT}${p.account}${" ".repeat(gap)}${p.amount}`;
24468
24470
  if (p.comment) {
24469
24471
  return `${line} ${p.comment}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuzzle/opencode-accountant",
3
- "version": "0.13.1-next.1",
3
+ "version": "0.13.2-next.1",
4
4
  "description": "An OpenCode accounting agent, specialized in double-entry-bookkepping with hledger",
5
5
  "author": {
6
6
  "name": "ali bengali",