@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.
- package/dist/index.js +3 -1
- 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
|
|
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