@hawkeyexl/manni 2.0.0 → 2.1.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/dist/cli.js CHANGED
@@ -1,21 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- STDIN_LINES_MARKER,
4
3
  buildProgram,
5
4
  collect,
6
5
  configOption,
7
6
  explicitFalse,
8
- fail,
9
7
  readStdin,
10
8
  reportConfig,
11
- runIfMain,
12
9
  splitList
13
- } from "./chunk-GGVNTB7W.js";
10
+ } from "./chunk-HNPRXGD7.js";
14
11
  import {
15
12
  CiteError,
16
13
  KeyError,
17
14
  SEVERITIES,
18
15
  SEVERITY_LIST,
16
+ asCiteError,
19
17
  isSeverity,
20
18
  meetsSeverity,
21
19
  renderCheckGithub,
@@ -32,7 +30,7 @@ import {
32
30
  shortPin,
33
31
  shortSrc,
34
32
  spellSource
35
- } from "./chunk-7ZN43F3Y.js";
33
+ } from "./chunk-UTXTVCBV.js";
36
34
  import {
37
35
  COMMON_FORMAT_LIST,
38
36
  OMITTED_WHEN_CLEAN,
@@ -42,6 +40,7 @@ import {
42
40
  ToolError,
43
41
  escapeWorkflowCommandMessage,
44
42
  escapeWorkflowCommandProperty,
43
+ fail,
45
44
  findConfigFile,
46
45
  isMachineFormat,
47
46
  isReportFormat,
@@ -51,10 +50,12 @@ import {
51
50
  programName,
52
51
  readConfigFile,
53
52
  render,
53
+ runIfMain,
54
54
  selectCollections,
55
55
  shouldColor,
56
+ splitPageArgument,
56
57
  terminalConfirm
57
- } from "./chunk-XU2QTJQQ.js";
58
+ } from "./chunk-2DC2GSRH.js";
58
59
 
59
60
  // src/cli.ts
60
61
  import { Command as Command4 } from "commander";
@@ -985,17 +986,8 @@ function colorOwner(command) {
985
986
  function isUpdateFormat(value) {
986
987
  return UPDATE_FORMATS.includes(value);
987
988
  }
988
- function splitPageArgument(arg) {
989
- const text = arg.startsWith(STDIN_LINES_MARKER) ? `${STDIN_TOKEN}${arg.slice(STDIN_LINES_MARKER.length)}` : arg;
990
- const m = /:([1-9][0-9]*)(?:-([1-9][0-9]*))?$/.exec(text);
991
- const head = m === null ? text : text.slice(0, m.index);
992
- if (m === null || head === "") return { page: arg };
993
- const start = Number(m[1]);
994
- const end = m[2] === void 0 ? start : Number(m[2]);
995
- if (end < start) {
996
- throw new CiteError(`Invalid range "${arg}": end line ${end} is before start line ${start}.`);
997
- }
998
- return { page: head, lines: { start, end } };
989
+ function splitPageArgument2(arg) {
990
+ return asCiteError(() => splitPageArgument(arg));
999
991
  }
1000
992
  function spellAt(lines, noun = "line") {
1001
993
  return lines.start === lines.end ? `${noun} ${String(lines.start)}` : `${noun}s ${String(lines.start)}-${String(lines.end)}`;
@@ -1149,7 +1141,7 @@ function buildProgram3() {
1149
1141
  ].join("\n")
1150
1142
  ).action(async (pageArgument, src, options) => {
1151
1143
  try {
1152
- const { page, lines } = splitPageArgument(pageArgument);
1144
+ const { page, lines } = splitPageArgument2(pageArgument);
1153
1145
  const usingStdin = page === STDIN_TOKEN;
1154
1146
  const stdinContent = usingStdin ? await readStdin() : void 0;
1155
1147
  const dryRun = Boolean(options.dryRun);