atris 3.74.7 → 3.74.8
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/lib/gm-bet.js +706 -161
- package/lib/gm-card.js +45 -4
- package/lib/gm-phone-page.js +450 -59
- package/lib/zen.js +15 -2
- package/package.json +1 -1
package/lib/zen.js
CHANGED
|
@@ -507,8 +507,21 @@ function shortPlace(p) {
|
|
|
507
507
|
function sideCopyLines(paths, days, waitMs = null) {
|
|
508
508
|
const n = paths.length;
|
|
509
509
|
const lines = [`${n} side ${n === 1 ? 'copy has' : 'copies have'} unsaved work, left for ${n === 1 ? 'its owner' : 'their owners'}`];
|
|
510
|
-
|
|
511
|
-
|
|
510
|
+
// Copies that share a folder (one workflow's runs, say) read as one line.
|
|
511
|
+
const folders = new Map();
|
|
512
|
+
for (const p of paths) {
|
|
513
|
+
const dir = path.dirname(p);
|
|
514
|
+
if (!folders.has(dir)) folders.set(dir, []);
|
|
515
|
+
folders.get(dir).push(p);
|
|
516
|
+
}
|
|
517
|
+
const rows = [];
|
|
518
|
+
for (const [dir, group] of folders) {
|
|
519
|
+
if (group.length >= 3) rows.push({ text: `${group.length} in ${shortPlace(dir)}/`, count: group.length });
|
|
520
|
+
else for (const p of group) rows.push({ text: shortPlace(p), count: 1 });
|
|
521
|
+
}
|
|
522
|
+
for (const row of rows.slice(0, 3)) lines.push(` ${row.text}`);
|
|
523
|
+
const rest = rows.slice(3).reduce((sum, row) => sum + row.count, 0);
|
|
524
|
+
if (rest) lines.push(` and ${rest} more`);
|
|
512
525
|
lines.push(`zen saves ${n === 1 ? 'it' : 'each one'} to zen-backup/ once nobody has touched it for ${days} ${days === 1 ? 'day' : 'days'}`);
|
|
513
526
|
if (waitMs > 0) lines.push(`${n === 1 ? 'that is' : 'the first one is'} due in ${waitText(waitMs)}`);
|
|
514
527
|
return lines;
|
package/package.json
CHANGED