bun-docx 0.20.1 → 0.20.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.
Files changed (2) hide show
  1. package/dist/index.js +10 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -82768,23 +82768,21 @@ function detectMarkdownInPlainText(text6) {
82768
82768
  return "a link ([text](url))";
82769
82769
  return null;
82770
82770
  }
82771
- async function rejectMarkdownInText(text6, help) {
82771
+ async function rejectMarkdownInText(text6) {
82772
82772
  const found = detectMarkdownInPlainText(text6);
82773
82773
  if (!found)
82774
82774
  return null;
82775
- return await fail("USAGE", `--text writes literal characters, but this value looks like markdown: ${found}. It would be baked in verbatim (e.g. literal ** around the word), not rendered.`, `Use --markdown to parse it (handles ${found}, headings, lists, links), --bold/--italic for a uniformly-emphasized run, or --runs for literal text that really contains these characters. Help:
82776
- ${help}`);
82775
+ return await fail("USAGE", `--text writes literal characters, but this value looks like markdown: ${found}. It would be baked in verbatim (e.g. literal ** around the word), not rendered.`, `Use --markdown to parse it (handles ${found}, headings, lists, links), --bold/--italic for a uniformly-emphasized run, or --runs for literal text that really contains these characters.`);
82777
82776
  }
82778
82777
  function detectShellMangledCurrency(text6) {
82779
82778
  const match = text6.match(/(?<![\d$])([.,]\d{2,})/);
82780
82779
  return match?.[1] ?? null;
82781
82780
  }
82782
- async function rejectShellMangledValue(text6, help, label = "this value") {
82781
+ async function rejectShellMangledValue(text6, label = "this value") {
82783
82782
  const fragment = detectShellMangledCurrency(text6);
82784
82783
  if (!fragment)
82785
82784
  return null;
82786
- return await fail("USAGE", `${label} contains "${fragment}" \u2014 a number with no integer part, the signature of a "$" amount gutted by the shell (bash turns double-quoted "$300.00" into ".00" and "$10,000" into ",000"). docx would write the corrupted value verbatim.`, `Wrap any "$"-bearing value in SINGLE quotes ('$300.00') so bash leaves it alone, or supply it via --batch FILE (JSONL never touches the shell). If you really mean "${fragment}", write its integer part (0${fragment}) or use --batch. Help:
82787
- ${help}`);
82785
+ return await fail("USAGE", `${label} contains "${fragment}" \u2014 a number with no integer part, the signature of a "$" amount gutted by the shell (bash turns double-quoted "$300.00" into ".00" and "$10,000" into ",000"). docx would write the corrupted value verbatim.`, `Wrap any "$"-bearing value in SINGLE quotes ('$300.00') so bash leaves it alone, or supply it via --batch FILE (JSONL never touches the shell). If you really mean "${fragment}", write its integer part (0${fragment}) or use --batch.`);
82788
82786
  }
82789
82787
  function decodeInlineEscapes(value) {
82790
82788
  if (value === undefined)
@@ -85930,10 +85928,10 @@ async function validateParagraphEdit(values2, paragraphOptions) {
85930
85928
  }
85931
85929
  return { kind: "removeLine" };
85932
85930
  }
85933
- const rejected = await rejectMarkdownInText(text6, HELP9);
85931
+ const rejected = await rejectMarkdownInText(text6);
85934
85932
  if (typeof rejected === "number")
85935
85933
  return rejected;
85936
- const mangled = await rejectShellMangledValue(text6, HELP9, "--text");
85934
+ const mangled = await rejectShellMangledValue(text6, "--text");
85937
85935
  if (typeof mangled === "number")
85938
85936
  return mangled;
85939
85937
  return {
@@ -88875,10 +88873,10 @@ async function buildSingleShotOptions(filePath, values2) {
88875
88873
  if (typeof spec === "number")
88876
88874
  return spec;
88877
88875
  if (spec.kind === "text") {
88878
- const rejected = await rejectMarkdownInText(spec.text, HELP20);
88876
+ const rejected = await rejectMarkdownInText(spec.text);
88879
88877
  if (typeof rejected === "number")
88880
88878
  return rejected;
88881
- const mangled = await rejectShellMangledValue(spec.text, HELP20, "--text");
88879
+ const mangled = await rejectShellMangledValue(spec.text, "--text");
88882
88880
  if (typeof mangled === "number")
88883
88881
  return mangled;
88884
88882
  }
@@ -94852,7 +94850,7 @@ async function run43(args) {
94852
94850
  }
94853
94851
  const cellTexts = parsed.values.cells ? parsed.values.cells.split(",") : [];
94854
94852
  for (const cell of cellTexts) {
94855
- const mangled = await rejectShellMangledValue(cell, HELP39, "--cells");
94853
+ const mangled = await rejectShellMangledValue(cell, "--cells");
94856
94854
  if (typeof mangled === "number")
94857
94855
  return mangled;
94858
94856
  }
@@ -98017,7 +98015,7 @@ Examples:
98017
98015
  // package.json
98018
98016
  var package_default = {
98019
98017
  name: "bun-docx",
98020
- version: "0.20.1",
98018
+ version: "0.20.2",
98021
98019
  description: "Read, edit, redline, and comment on Microsoft Word .docx files from the command line \u2014 built for AI agents.",
98022
98020
  keywords: [
98023
98021
  "docx",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bun-docx",
3
- "version": "0.20.1",
3
+ "version": "0.20.2",
4
4
  "description": "Read, edit, redline, and comment on Microsoft Word .docx files from the command line — built for AI agents.",
5
5
  "keywords": [
6
6
  "docx",