@mark1russell7/rigor-bench 0.2.22 → 0.2.23

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/README.md CHANGED
@@ -402,6 +402,32 @@ A run of many jobs sets `roundOffset` to `job * rounds`. Then the merged records
402
402
 
403
403
  A rotation of N arms turns the order of two arms only when they are N/2 apart in the rotation. For 4 arms, two arms 1 apart come in the order 3:1 over 4 rounds. Thus each pair of `freshRun` has its own two children, and the order of each pair turns each round.
404
404
 
405
+ ## A result that changes on purpose
406
+
407
+ A bench compares two arms, and two arms with different results do not do the same work. So a difference stops the merge. A pull request can change a result on purpose. Without a stated path, its author edits the case, and no gate reads that edit. A row in the diff gives that path, and it names the exact change.
408
+
409
+ ```ts
410
+ import { resultRows, resultVerdict } from "@mark1russell7/rigor-bench";
411
+
412
+ const verdict = resultVerdict(
413
+ [{ case: "facts of a tree", base: "9f3a", head: "c81e" }], // the hash of the result of each case in the two arms
414
+ { base: resultRows(rowsOfTheBase), head: resultRows(rowsOfTheHead) }, // the parsed file of rows in each arm
415
+ );
416
+
417
+ verdict.outcome; // "pass" or "fail"
418
+ verdict.lines; // the lines that the check prints
419
+ ```
420
+
421
+ A row has four fields: `case`, `base`, `head` and `reason`. The fields `base` and `head` are hashes that the caller makes, so a large result stays out of the file. A reviewer can read a row against the run. A refused line prints the row to add. These rules stop the reuse of a row:
422
+
423
+ - **The hashes bind the row to one change.** The same row against one other result reads `refused`, and the line says which side moved: the base, the head or both. The fields have an order, so a row of a change does not accept its revert.
424
+ - **A row counts only if it is new.** A row that the base also has is spent and accepts nothing, even on the same change. The verdict keeps the array `spent`, and it prints one line with the count.
425
+ - **A new row that accepts nothing fails the verdict.** A row of a case with one result reads `unused`. Otherwise it merges and is spent, and a later true change is refused.
426
+ - **A row of a case with no result fails the verdict.** It reads `absent`, because a missing read is no pass. The case can be skipped or filtered out, so the line does not tell the author to delete the row.
427
+ - **A change that comes again needs two pull requests.** The first one deletes the spent row, and the second one adds it. A revert can delete the row in the same pull request.
428
+
429
+ **Time.** The verdict reads results only. An accepted result buys no time reading. Keep the accepted case in `freshRun`, so it gets its head and A/A pairs and its normal time verdict. The time of the new result counts. The hash rule of `freshRun` is per arm, so two arms with different hashes run. The test "refuses two hashes of one arm on one case, and permits other hashes for other arms" pins this rule.
430
+
405
431
  ## The stamp of the code of a run
406
432
 
407
433
  The entry `@mark1russell7/rigor-bench/code-stamp` is for Node only. It uses the optional peer `esbuild`. Add `esbuild` to the dependencies of the caller, so that its lock file pins the version.
package/build/index.d.ts CHANGED
@@ -1335,6 +1335,71 @@ interface Power {
1335
1335
  * Each arm of each round adds a normal noise of `sigma` to the log time.
1336
1336
  */
1337
1337
  export declare function verdictPower(options: PowerOptions): Power;
1338
+ /**
1339
+ * The rows that accept a changed result of a bench case. A bench compares two arms, and two arms with different results do not do the same work.
1340
+ * So a difference stops the merge. A pull request can change a result on purpose, and without a stated path its author edits the case, and no gate reads that edit.
1341
+ * A row is that stated path. It names the case and the hash of each result, and it gives a reason. A reviewer can read the row against the run.
1342
+ *
1343
+ * Three rules stop the reuse of a row. The fields `base` and `head` bind the row to one change in one direction. A row counts only if it is new: the rows of the base are spent.
1344
+ * A new row that accepts nothing is a fault. These rules read results only, so the time of an accepted case stays with the time verdict of the bench.
1345
+ */
1346
+ /**
1347
+ * One row: a statement that the result of one case changes on purpose.
1348
+ * The caller uses one hash function for the row and for the run. Two hash functions give a refused line on each row, and each line reads "both sides moved".
1349
+ */
1350
+ interface ResultRow {
1351
+ readonly case: string;
1352
+ /** The hash of the result of the base arm. The caller makes the hash, so a large result stays out of the file of rows. */
1353
+ readonly base: string;
1354
+ /** The hash of the result of the head arm. */
1355
+ readonly head: string;
1356
+ /** The reason for the change, in plain words. The verdict prints it. */
1357
+ readonly reason: string;
1358
+ }
1359
+ /** The hash of the result of one case in each arm. The hashes come from the same function as the hashes of the rows. */
1360
+ interface CaseResults {
1361
+ readonly case: string;
1362
+ readonly base: string;
1363
+ readonly head: string;
1364
+ }
1365
+ /** The rows of the base and of the head. A row of the head that the base also has is spent. */
1366
+ interface ResultRows {
1367
+ readonly base: readonly ResultRow[];
1368
+ readonly head: readonly ResultRow[];
1369
+ }
1370
+ /** The read of one case with two different results. */
1371
+ interface ResultRead extends CaseResults {
1372
+ readonly outcome: "accepted" | "refused";
1373
+ /** The line that the check prints. A refused line gives the path through. */
1374
+ readonly line: string;
1375
+ }
1376
+ /** The read of one new row that accepted nothing. */
1377
+ interface RowRead {
1378
+ readonly row: ResultRow;
1379
+ readonly line: string;
1380
+ }
1381
+ /** A verdict over the results of a run and the rows. */
1382
+ interface ResultVerdict {
1383
+ /** The value "fail" means a refused case, or a new row that accepted nothing. */
1384
+ readonly outcome: "pass" | "fail";
1385
+ /** The cases with two different results. */
1386
+ readonly cases: readonly ResultRead[];
1387
+ /** The new rows of a case with one result, or with another change. Each one fails the verdict. */
1388
+ readonly unused: readonly RowRead[];
1389
+ /** The new rows of a case with no result in this run. The case can be skipped or filtered out. A missing read is no pass, so each one fails the verdict. */
1390
+ readonly absent: readonly RowRead[];
1391
+ /** The rows of the base that the head keeps. They accept nothing, and they do not fail the verdict. */
1392
+ readonly spent: readonly ResultRow[];
1393
+ /** The lines of `cases`, `unused` and `absent`, then one line with the count of `spent`. */
1394
+ readonly lines: readonly string[];
1395
+ }
1396
+ /** This function checks the parsed content of a file of rows. A row with an empty field, or the same row two times, stops the read with an error. */
1397
+ export declare function resultRows(content: unknown): ResultRow[];
1398
+ /**
1399
+ * This function gives the verdict over the results of a run. A case with two different results passes only with a new row of its exact hashes.
1400
+ * The verdict reads results only, so an accepted case still needs its time verdict.
1401
+ */
1402
+ export declare function resultVerdict(results: readonly CaseResults[], rows: ResultRows): ResultVerdict;
1338
1403
  /** The options of the timed rounds of one case. */
1339
1404
  interface RoundsOptions {
1340
1405
  /** The name of the case. */
@@ -1364,5 +1429,5 @@ interface Rounds {
1364
1429
  * keeps the work.
1365
1430
  */
1366
1431
  export declare function timeRounds(arms: Readonly<Record<Arm, () => number>>, options: RoundsOptions): Rounds;
1367
- export { type Arm, type ArmModels, type ArmPair, type Balanced, type Band, type BandKind, type BandOptions, type BudgetLook, type BudgetLooksOptions, type BudgetLooksVerdict, type BudgetMore, type BudgetOptions, type BudgetOutcome, type BudgetResult, type BudgetRound, type BudgetVerdict, type CaseBudget, type CaseGate, type CaseInterval, type CaseLimit, type CaseRatio, type CaseTail, type CaseTailLimit, type Comparison, type ControlFactors, type ControlOptions, type ControlRead, type ControlRow, type EntryCount, type Gate, type GateCaseOutcome, type GateJobRead, type GateOutcome, type GroupCounts, type GroupFactor, type GuardRead, type JobLimitVerdict, type JobRecords, type JobVerdict, type JointClaim, type JointControl, type JointMeasure, type JointVerdict, type Ladder, type LadderDimension, type LadderOptions, type LadderVerdict, type LimitOnModel, type LimitOptions, type LimitOutcome, type LimitVerdict, type MeasureCheck, type MeasureCheckOptions, type MeasureChecks, type MeasureFinding, type MeasureFindingKind, type MeasureRow, type MeasureRule, type MeasuredFactor, type MedianBudget, type ModelLimits, type ModelRead, type ModelRow, type ModelStatus, type ModelTest, type ModelTestOptions, type NoControl, type NoFactor, type NoiseCheck, type NotSlowerOptions, type NotSlowerRead, type NotSlowerVerdict, type OrderSize, type PairedTime, type PartnerRead, type PoolFacts, type PoolOptions, type PooledJob, type PooledLimitVerdict, type PooledRecords, type PooledVerdict, type Power, type PowerOptions, type QuantileBudget, type RateBudget, type Rounds, type RoundsOptions, type RunPairs, type Rung, type RungBudget, type RungEvidence, type RungRecord, type RungVerdict, type SpreadRead, type TailFalseFails, type TailGainCase, type TailLimit, type TailLimitOptions, type TailLimitVerdict, type TailRuleOptions, type TimeOutcome, type TimeVerdict, type VerdictOptions, type VerdictRule, type VisibleShift, type WinClaim, type WorstBudget, armOrder, caseRatios, checkPairedTime, firstArm, orderSize };
1432
+ export { type Arm, type ArmModels, type ArmPair, type Balanced, type Band, type BandKind, type BandOptions, type BudgetLook, type BudgetLooksOptions, type BudgetLooksVerdict, type BudgetMore, type BudgetOptions, type BudgetOutcome, type BudgetResult, type BudgetRound, type BudgetVerdict, type CaseBudget, type CaseGate, type CaseInterval, type CaseLimit, type CaseRatio, type CaseResults, type CaseTail, type CaseTailLimit, type Comparison, type ControlFactors, type ControlOptions, type ControlRead, type ControlRow, type EntryCount, type Gate, type GateCaseOutcome, type GateJobRead, type GateOutcome, type GroupCounts, type GroupFactor, type GuardRead, type JobLimitVerdict, type JobRecords, type JobVerdict, type JointClaim, type JointControl, type JointMeasure, type JointVerdict, type Ladder, type LadderDimension, type LadderOptions, type LadderVerdict, type LimitOnModel, type LimitOptions, type LimitOutcome, type LimitVerdict, type MeasureCheck, type MeasureCheckOptions, type MeasureChecks, type MeasureFinding, type MeasureFindingKind, type MeasureRow, type MeasureRule, type MeasuredFactor, type MedianBudget, type ModelLimits, type ModelRead, type ModelRow, type ModelStatus, type ModelTest, type ModelTestOptions, type NoControl, type NoFactor, type NoiseCheck, type NotSlowerOptions, type NotSlowerRead, type NotSlowerVerdict, type OrderSize, type PairedTime, type PartnerRead, type PoolFacts, type PoolOptions, type PooledJob, type PooledLimitVerdict, type PooledRecords, type PooledVerdict, type Power, type PowerOptions, type QuantileBudget, type RateBudget, type ResultRead, type ResultRow, type ResultRows, type ResultVerdict, type Rounds, type RoundsOptions, type RowRead, type RunPairs, type Rung, type RungBudget, type RungEvidence, type RungRecord, type RungVerdict, type SpreadRead, type TailFalseFails, type TailGainCase, type TailLimit, type TailLimitOptions, type TailLimitVerdict, type TailRuleOptions, type TimeOutcome, type TimeVerdict, type VerdictOptions, type VerdictRule, type VisibleShift, type WinClaim, type WorstBudget, armOrder, caseRatios, checkPairedTime, firstArm, orderSize };
1368
1433
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["Comparison"],"sources":["../src/budget.ts","../src/verdict.ts","../src/limit.ts","../src/merge.ts","../src/gate.ts","../src/control.ts","../src/ladder.ts","../src/model.ts","../src/tail.ts","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/F;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA,UAAU;;;UAIJ;WACN;WACA,UAAU,SAAS,OAAO;;;;;;WAM1B;;;;;;wBAOK,aAAa,SAAS,eAAe;;UClCpC;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;UAIM;WACN,SAAS;;WAET;;WAEA;;;;;;;wBAQK,WAAW,MAAM,SAAS,OAAO,qBAAqB,SAAS,gBAAgB"}
1
+ {"version":3,"file":"index.d.ts","names":["Comparison"],"sources":["../src/budget.ts","../src/verdict.ts","../src/limit.ts","../src/merge.ts","../src/gate.ts","../src/control.ts","../src/ladder.ts","../src/model.ts","../src/tail.ts","../src/measures.ts","../src/power.ts","../src/results.ts","../src/rounds.ts"],"mappings":";;;UAQiB;;WAEN;;WAEA;WACA;;;KAIC;;UAGK;;WAEN;;WAEA;;WAEA;;;UAIM;WACN;;WAEA;;WAEA;WACA;;WAEA;;WAEA;;WAEA;WACA;;WAEA;WACA,SAAS;;WAET;;;UAIM;WACN,SAAS;;WAET;WACA;WACA;WACA;WACA,gBAAgB;;;;;;;;;;;;wBAyDX,cAAc,iBAAiB,eAAe,aAAa,eAAe,SAAS,gBAAgB;;UAyBlG;WACN;WACA;;;;;;qBAOE,uBAAuB;;UAOnB;;WAEN;;WAEA;;WAEA,iBAAiB;;WAEjB;;;UAIM;WACN;WACA;;;UAIM,2BAA2B;;WAEjC;;WAEA,eAAe;;WAEf;;;;;;wBAOK,gBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;wBAoDhC,mBAAmB,iBAAiB,eAAe,aAAa,eAAe,SAAS,qBAAqB;;;;;;KCnOjH;;UAGK;;WAEN,OAAO;;WAEP;;WAEA;;WAEA,YAAY;;;UAIN;;WAEN;WACA,MAAM;;;;;;WAMN;;WAEA;WACA;;WAEA;;;wBAIK,OAAO,aAAa,cAAc,UAAS,cAAmB;;;;;wBAoB9D,SAAS,aAAa,cAAc;;UAWnC;;WAEN,kBAA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;UAIb;;WAEN;;WAEA;;WAEA;;WAEA;aAAqB;aAAwB;eAA8B;eAA0B;;;;WAErG,MAAM;;;UAIA;WACN;;WAEA;;WAEA;;WAEA;;WAEA;;;UAIM;WACN;;WAEA;;WAEA;;WAEA;;WAEA;;;;;;KAOC;;UAGK;WACN;WACA;WACA,SAAS;;WAET;;WAEA;;WAEA;WACA,mBAAmB;WACnB,mBAAmB;;;;;;;;;;;;;;;;;;wBAqVd,cAAc,eAAe,cAAc,SAAS,sBAAsB;;;;;;;wBAgC1E,SAAS,OAAO,eAAe,iBAAiB,eAAe,mBAAmB;;;;;;;;;;wBAiClF,WAAW,OAAO,eAAe,6BAA6B,eAAe,mBAAmB;;UCxpB/F;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA,UAAU;;;UAIJ;WACN;WACA,UAAU,SAAS,OAAO;;;;;;WAM1B;;;;;;wBAOK,aAAa,SAAS,eAAe;;;;;;;;;;;;;UC7BpC;WACN;;WAEA;;WAEA;;WAEA;;;UAIM;WACN;WACA;WACA;;;UAIM;WACN,eAAe;WACf,eAAe;;;UAIT,mBAAmB;WACzB;;WAEA;;;UAIM;WACN,KAAK;WACL;;;UAIM;;WAEN;;WAEA,gBAAgB;;WAEhB,iBAAiB;;WAEjB,iBAAiB;;WAEjB,gBAAgB;;WAEhB;;;wBAMK,WAAW,mBAAmB;;;;;wBAuC9B,cAAc,kBAAkB,eAAe,MAAM,aAAa;;UCnGjE;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;UAIM;WACN,SAAS;;WAET;;WAEA;;;;;;;wBAQK,WAAW,MAAM,SAAS,OAAO,qBAAqB,SAAS,gBAAgB"}
package/build/index.js CHANGED
@@ -2295,6 +2295,110 @@ function trueOutcome(ratio, verdict = {}) {
2295
2295
  if ((verdict.rule ?? "difference") === "difference" && Math.abs(Math.log(ratio)) <= verdictMargin(verdict)) return "same";
2296
2296
  return ratio < 1 ? "faster" : ratio > 1 ? "slower" : "same";
2297
2297
  }
2298
+ // src/results.ts
2299
+ const keyOf = (row) => JSON.stringify([
2300
+ row.case,
2301
+ row.base,
2302
+ row.head
2303
+ ]);
2304
+ /** This function checks the parsed content of a file of rows. A row with an empty field, or the same row two times, stops the read with an error. */
2305
+ function resultRows(content) {
2306
+ if (!Array.isArray(content)) throw new Error("resultRows: the rows are an array.");
2307
+ const known = /* @__PURE__ */ new Set();
2308
+ return content.map((item, index) => {
2309
+ const row = typeof item === "object" && item !== null ? item : {};
2310
+ const where = `resultRows: row ${String(index)}`;
2311
+ const { case: name, base, head, reason } = row;
2312
+ if (typeof name !== "string" || name === "") throw new Error(`${where} has no case.`);
2313
+ if (typeof base !== "string" || base === "") throw new Error(`${where} has no hash of the base.`);
2314
+ if (typeof head !== "string" || head === "") throw new Error(`${where} has no hash of the head.`);
2315
+ if (typeof reason !== "string" || reason.trim() === "") throw new Error(`${where} has no reason.`);
2316
+ const key = keyOf({
2317
+ case: name,
2318
+ base,
2319
+ head
2320
+ });
2321
+ if (known.has(key)) throw new Error(`${where} repeats the case ${JSON.stringify(name)} with the same hashes.`);
2322
+ known.add(key);
2323
+ return {
2324
+ case: name,
2325
+ base,
2326
+ head,
2327
+ reason
2328
+ };
2329
+ });
2330
+ }
2331
+ /** This function tells which side of a run differs from a row. */
2332
+ function moved(item, row) {
2333
+ if (item.base !== row.base && item.head !== row.head) return "both sides moved";
2334
+ return item.base !== row.base ? "the base moved" : "the head moved";
2335
+ }
2336
+ /** This function gives the line of a case that no row accepts. */
2337
+ function refusal(item, live, spent) {
2338
+ const start = `The case ${JSON.stringify(item.case)} gives two different results`;
2339
+ if (spent.has(keyOf(item))) return `${start}, and the base already has the row of this change, so that row is spent. Delete that row in its own pull request, then add the row again.`;
2340
+ const others = live.filter((row) => row.case === item.case);
2341
+ const read = `base ${item.base} and head ${item.head}`;
2342
+ if (others.length > 0) return `${start}: ${read}. ${others.map((row) => `A row accepts base ${row.base} and head ${row.head}, so ${moved(item, row)}.`).join(" ")}`;
2343
+ return `${start}, and no row accepts them. To accept this change, add the row ${JSON.stringify({
2344
+ case: item.case,
2345
+ base: item.base,
2346
+ head: item.head,
2347
+ reason: "the reason for the change"
2348
+ })} in this pull request.`;
2349
+ }
2350
+ /**
2351
+ * This function gives the verdict over the results of a run. A case with two different results passes only with a new row of its exact hashes.
2352
+ * The verdict reads results only, so an accepted case still needs its time verdict.
2353
+ */
2354
+ function resultVerdict(results, rows) {
2355
+ const spentKeys = new Set(rows.base.map(keyOf));
2356
+ const live = rows.head.filter((row) => !spentKeys.has(keyOf(row)));
2357
+ const used = /* @__PURE__ */ new Set();
2358
+ const cases = results.filter((item) => item.base !== item.head).map((item) => {
2359
+ const row = live.find((other) => keyOf(other) === keyOf(item));
2360
+ if (row === void 0) return {
2361
+ case: item.case,
2362
+ base: item.base,
2363
+ head: item.head,
2364
+ outcome: "refused",
2365
+ line: refusal(item, live, spentKeys)
2366
+ };
2367
+ used.add(keyOf(row));
2368
+ return {
2369
+ case: item.case,
2370
+ base: item.base,
2371
+ head: item.head,
2372
+ outcome: "accepted",
2373
+ line: `The case ${JSON.stringify(item.case)} changes its result from ${item.base} to ${item.head}, and a row accepts this: ${row.reason}`
2374
+ };
2375
+ });
2376
+ const named = new Set(results.map((item) => item.case));
2377
+ const idle = live.filter((row) => !used.has(keyOf(row)));
2378
+ const unused = idle.filter((row) => named.has(row.case)).map((row) => ({
2379
+ row,
2380
+ line: `The new row of the case ${JSON.stringify(row.case)} accepts no change of this run. Delete or correct the row.`
2381
+ }));
2382
+ const absent = idle.filter((row) => !named.has(row.case)).map((row) => ({
2383
+ row,
2384
+ line: `The new row of the case ${JSON.stringify(row.case)} has no read: the case has no result in this run.`
2385
+ }));
2386
+ const spent = rows.head.filter((row) => spentKeys.has(keyOf(row)));
2387
+ const fails = cases.some((item) => item.outcome === "refused") || unused.length > 0 || absent.length > 0;
2388
+ const count = spent.length > 0 ? [`The spent rows: ${String(spent.length)}. The base has them, so they accept nothing.`] : [];
2389
+ return {
2390
+ outcome: fails ? "fail" : "pass",
2391
+ cases,
2392
+ unused,
2393
+ absent,
2394
+ spent,
2395
+ lines: [...[
2396
+ ...cases,
2397
+ ...unused,
2398
+ ...absent
2399
+ ].map((item) => item.line), ...count]
2400
+ };
2401
+ }
2298
2402
  // src/rounds.ts
2299
2403
  /**
2300
2404
  * The timed rounds of one case in one process. The two arms first run for a warm-up time. Then the count of calls of
@@ -2351,6 +2455,6 @@ function timeRounds(arms, options) {
2351
2455
  sink
2352
2456
  };
2353
2457
  }
2354
- export { BUDGET_LOOKS, CEILING_ONLY, GATE_LOOKS, LADDER_FORMAT, UNKNOWN_MODEL, aaBand, aaSpread, armModels, armOrder, armVerdicts, balanceOrders, budgetLookSpend, budgetLooksVerdict, budgetVerdict, caseIntervals, caseRatios, caseTails, checkLadder, checkMeasures, checkPairedTime, controlFactor, firstArm, gateOf, jointClaim, ladderVerdict, limitOnModel, limitVerdict, modelRowText, modelTest, notSlowerVerdict, orderSize, poolRecords, pooledBand, pooledLimitVerdict, pooledVerdict, rungVerdict, tailFalseFails, tailLimitVerdict, timeRounds, timeVerdict, verdictMargin, verdictPower, visibleShift, winClaim };
2458
+ export { BUDGET_LOOKS, CEILING_ONLY, GATE_LOOKS, LADDER_FORMAT, UNKNOWN_MODEL, aaBand, aaSpread, armModels, armOrder, armVerdicts, balanceOrders, budgetLookSpend, budgetLooksVerdict, budgetVerdict, caseIntervals, caseRatios, caseTails, checkLadder, checkMeasures, checkPairedTime, controlFactor, firstArm, gateOf, jointClaim, ladderVerdict, limitOnModel, limitVerdict, modelRowText, modelTest, notSlowerVerdict, orderSize, poolRecords, pooledBand, pooledLimitVerdict, pooledVerdict, resultRows, resultVerdict, rungVerdict, tailFalseFails, tailLimitVerdict, timeRounds, timeVerdict, verdictMargin, verdictPower, visibleShift, winClaim };
2355
2459
 
2356
2460
  //# sourceMappingURL=index.js.map