@i4ctime/q-ring 0.9.5 → 0.9.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/mcp.js CHANGED
@@ -281,7 +281,14 @@ function parseDotenv(content) {
281
281
  if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
282
282
  value = value.slice(1, -1);
283
283
  }
284
- value = value.replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\t/g, " ").replace(/\\\\/g, "\\").replace(/\\"/g, '"');
284
+ const escapeMap = {
285
+ n: "\n",
286
+ r: "\r",
287
+ t: " ",
288
+ "\\": "\\",
289
+ '"': '"'
290
+ };
291
+ value = value.replace(/\\([nrt"\\])/g, (_, ch) => escapeMap[ch] ?? ch);
285
292
  if (value.includes("#") && !line.includes('"') && !line.includes("'")) {
286
293
  value = value.split("#")[0].trim();
287
294
  }