From 3b0668ce812ddc5aa46e88e190086173793b5d1b Mon Sep 17 00:00:00 2001 From: petersirka Date: Mon, 2 Sep 2024 10:01:49 +0200 Subject: [PATCH] Improved config & resource parser by adding support for `=` between key and value and for `#` as a comment. --- changelog.txt | 1 + index.js | 2 +- utils.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 7f9eb14..9c1ec9a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -19,6 +19,7 @@ - fixed `CACHE.read()` - added a new argument `size {Number}` to the `WebSocket.on('message', function(client, msg, [size]))` event - fixed `@{href()}` command in the ViewEngine +- improved config & resource parser by adding support for `=` between key and value and for `#` as a comment ======================== 0.0.5 diff --git a/index.js b/index.js index cdc95a7..cc68373 100644 --- a/index.js +++ b/index.js @@ -650,7 +650,7 @@ F.loadresource = function(name, value) { let index = line.indexOf(':'); if (index === -1) { - index = line.indexOf('\t:'); + index = line.indexOf('='); if (index === -1) continue; } diff --git a/utils.js b/utils.js index aa7eb7b..7209f40 100755 --- a/utils.js +++ b/utils.js @@ -3218,7 +3218,7 @@ SP.parseConfig = function(def, onerr) { index = str.indexOf(':'); if (index === -1) { - index = str.indexOf('\t:'); + index = str.indexOf('='); if (index === -1) continue; }