aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/sbbuilder/Toml.js
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/modules/sbbuilder/Toml.js')
-rw-r--r--desktop/modules/sbbuilder/Toml.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/desktop/modules/sbbuilder/Toml.js b/desktop/modules/sbbuilder/Toml.js
index 46b9914..dddb6f7 100644
--- a/desktop/modules/sbbuilder/Toml.js
+++ b/desktop/modules/sbbuilder/Toml.js
@@ -92,6 +92,9 @@ function ranges(lines) {
return out;
}
+// The [section] names present, in file order; "" is not one.
+function sections(text) { return ranges(text.split("\n")).slice(1).map(r => r.name); }
+
// [{key, value}] for the active keys of a section, in file order.
function entries(text, section) {
const lines = text.split("\n");