@feigi/fleet-ctl 3.128.1 → 3.128.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/package.json
CHANGED
|
@@ -83,7 +83,6 @@
|
|
|
83
83
|
// is TRIP_POINTS or more points above the baseline's, compared in integer
|
|
84
84
|
// counts. The guard holds it pooled; the fit holds it per row.
|
|
85
85
|
|
|
86
|
-
import { isDigits } from "./arg.mjs";
|
|
87
86
|
import { CELL } from "./ledger-grammar.mjs";
|
|
88
87
|
import { parseMemberName } from "./member-record.mjs";
|
|
89
88
|
import { isImplementer } from "./member-outcomes.mjs";
|
|
@@ -156,8 +155,12 @@ const METRIC = Object.freeze({ usd: (u) => u.spend, minutes: (u) => u.workS / 60
|
|
|
156
155
|
// A counted Pull as a bootstrap unit, its `value` the Pull's `metric`.
|
|
157
156
|
export const bootUnit = (u, metric = "usd") => ({ value: METRIC[metric](u), merged: u.merged ? 1 : 0 });
|
|
158
157
|
|
|
158
|
+
const ISSUE_NUMBER = /^[1-9][0-9]*$/;
|
|
159
|
+
|
|
159
160
|
// ticket-features.tsv: one bare header line naming the columns, then rows.
|
|
160
161
|
// Read by header name; a row whose width differs from the header's is refused.
|
|
162
|
+
// So is a row whose `ticket` is not an issue number (`[1-9][0-9]*`, no
|
|
163
|
+
// leading zero), or whose `parent` is neither blank nor one.
|
|
161
164
|
export function parseFeatures(text) {
|
|
162
165
|
const lines = String(text ?? "").split("\n").filter((l) => l.trim() && !l.startsWith("#"));
|
|
163
166
|
if (lines.length === 0) throw new Error("ticket-features.tsv has no header line");
|
|
@@ -171,8 +174,8 @@ export function parseFeatures(text) {
|
|
|
171
174
|
}
|
|
172
175
|
const row = Object.fromEntries(header.map((c, j) => [c, cells[j]]));
|
|
173
176
|
for (const c of OPTIONAL_COLUMNS) row[c] ??= "";
|
|
174
|
-
if (!
|
|
175
|
-
if (row.parent !== "" && !
|
|
177
|
+
if (!ISSUE_NUMBER.test(row.ticket)) throw new Error(`ticket-features.tsv row ${i + 1}: ticket ${JSON.stringify(row.ticket)} is not an issue number`);
|
|
178
|
+
if (row.parent !== "" && !ISSUE_NUMBER.test(row.parent)) throw new Error(`ticket-features.tsv row ${i + 1}: parent ${JSON.stringify(row.parent)} is not blank or an issue number`);
|
|
176
179
|
if (!CELL.test(row.chosen_cell)) throw new Error(`ticket-features.tsv row ${i + 1}: chosen_cell ${JSON.stringify(row.chosen_cell)} is not a cell`);
|
|
177
180
|
return row;
|
|
178
181
|
});
|