@biffo/cli 0.103.4 → 0.103.5

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 +15 -20
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6677,31 +6677,26 @@ import { join as join25 } from "path";
6677
6677
  function readTomlStringArray(text, key) {
6678
6678
  const open = new RegExp(`^${key}\\s*=\\s*\\[`, "m").exec(text);
6679
6679
  if (!open) return [];
6680
- const start = open.index + open[0].length;
6680
+ const strings = [];
6681
6681
  let depth = 1;
6682
- let inString = false;
6683
- let quote = "";
6684
- let end = -1;
6685
- for (let i = start; i < text.length; i++) {
6682
+ let i = open.index + open[0].length;
6683
+ while (i < text.length && depth > 0) {
6686
6684
  const c = text[i];
6687
- if (inString) {
6688
- if (c === quote) inString = false;
6685
+ if (c === "#") {
6686
+ const nl = text.indexOf("\n", i);
6687
+ i = nl === -1 ? text.length : nl;
6689
6688
  } else if (c === '"' || c === "'") {
6690
- inString = true;
6691
- quote = c;
6692
- } else if (c === "[") {
6693
- depth++;
6694
- } else if (c === "]") {
6695
- depth--;
6696
- if (depth === 0) {
6697
- end = i;
6698
- break;
6699
- }
6689
+ const close = text.indexOf(c, i + 1);
6690
+ if (close === -1) break;
6691
+ if (depth === 1) strings.push(text.slice(i + 1, close));
6692
+ i = close + 1;
6693
+ } else {
6694
+ if (c === "[") depth++;
6695
+ else if (c === "]") depth--;
6696
+ i++;
6700
6697
  }
6701
6698
  }
6702
- if (end === -1) return [];
6703
- const body = text.slice(start, end);
6704
- return [...body.matchAll(/["']([^"']+)["']/g)].map((m) => m[1]);
6699
+ return depth === 0 ? strings : [];
6705
6700
  }
6706
6701
  function readProjectName(text) {
6707
6702
  let inProject = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biffo/cli",
3
- "version": "0.103.4",
3
+ "version": "0.103.5",
4
4
  "description": "Biffo project scaffolding CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",