@hawkeyexl/manni 2.9.0-cite-marker-ids.3 → 2.9.0

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
@@ -98,7 +98,7 @@ actually reads rather than hand-written:
98
98
  ```yaml
99
99
  repos:
100
100
  - repo: https://github.com/hawkeyexl/manni
101
- rev: v2.8.5
101
+ rev: v2.9.0
102
102
  hooks:
103
103
  - id: manni-meta
104
104
  ```
@@ -8,7 +8,7 @@ var __export = (target, all) => {
8
8
  // package.json
9
9
  var package_default = {
10
10
  name: "@hawkeyexl/manni",
11
- version: "2.9.0-cite-marker-ids.3",
11
+ version: "2.9.0",
12
12
  description: "One command line for documentation that is meant to be checked. `manni meta` validates the presence and format of document metadata (Markdown frontmatter and more) against JSON Schema, built for CI. Formerly docmeta.",
13
13
  type: "module",
14
14
  bin: {
@@ -10191,7 +10191,8 @@ function findWindows(lines, length, pin, key, opts) {
10191
10191
  }
10192
10192
  return { starts, truncated: false };
10193
10193
  }
10194
- const budget = opts?.budget ?? MOVE_BUDGET_BYTES;
10194
+ const counter = opts?.counter;
10195
+ const budget = counter?.left ?? opts?.budget ?? MOVE_BUDGET_BYTES;
10195
10196
  const around = opts?.around ?? 1;
10196
10197
  const bandStart = Math.max(1, around - MOVE_WINDOW_LINES);
10197
10198
  const bandEnd = Math.min(lastStart, around + MOVE_WINDOW_LINES);
@@ -10203,10 +10204,14 @@ function findWindows(lines, length, pin, key, opts) {
10203
10204
  for (const start of order) {
10204
10205
  const text2 = joined(start);
10205
10206
  const bytes = Buffer.byteLength(text2, "utf8");
10206
- if (spent + bytes > budget) return { starts, truncated: true };
10207
+ if (spent + bytes > budget) {
10208
+ if (counter !== void 0) counter.left = budget - spent;
10209
+ return { starts, truncated: true };
10210
+ }
10207
10211
  spent += bytes;
10208
10212
  if (hashLines(text2, key) === pin) starts.push(start);
10209
10213
  }
10214
+ if (counter !== void 0) counter.left = budget - spent;
10210
10215
  return { starts, truncated: false };
10211
10216
  }
10212
10217
  var RANGE_SPEC = /^([1-9][0-9]*)(?:-([1-9][0-9]*))?$/;
@@ -20150,4 +20155,4 @@ export {
20150
20155
  renderQuery,
20151
20156
  renderQueryCsv
20152
20157
  };
20153
- //# sourceMappingURL=chunk-YTERMDVD.js.map
20158
+ //# sourceMappingURL=chunk-5A3XPOTD.js.map