@biffo/cli 0.103.4 → 0.103.6
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/index.js +15 -20
- 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
|
|
6680
|
+
const strings = [];
|
|
6681
6681
|
let depth = 1;
|
|
6682
|
-
let
|
|
6683
|
-
|
|
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 (
|
|
6688
|
-
|
|
6685
|
+
if (c === "#") {
|
|
6686
|
+
const nl = text.indexOf("\n", i);
|
|
6687
|
+
i = nl === -1 ? text.length : nl;
|
|
6689
6688
|
} else if (c === '"' || c === "'") {
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
} else
|
|
6695
|
-
depth
|
|
6696
|
-
if (
|
|
6697
|
-
|
|
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
|
-
|
|
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;
|