You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
;; is read as an escaped semicolon in values, and build() does not quote leading/trailing spaces, leading quotes, or = in keys #298
parse() treats ;; inside an unquoted value as an escaped semicolon (swallowing the following key/value pair) and keeps a leading ; on the first key, while build() does not quote values with leading/trailing whitespace or a leading '/" and does not escape = in keys (separate from #279, which covers empty values, {...} values, and bare ().
parse("Server=h;;Database=d;User Id=u") returns {"server":"h","database":"d","user id":"u"}, and parse(";Server=h") returns {"server":"h"}. Per the SqlConnection.ConnectionString syntax linked in the README, ; separates pairs (extra semicolons before or between pairs are skipped) and a ; inside a value requires quotes; doubling only escapes = in keywords (==) and closing quotes inside quoted values.
build({ Password: v }) quotes values with leading/trailing whitespace or a leading ' or " (for example wrapping in {...} with } doubled), so parse(build({ Password: v })).get("password") returns " secret ", "'abc", and "\"x\"".
build({ "a=b": "1" }) writes "a==b=1", which parse() reads back as {"a=b":"1"}.
In src/parser/connection-string-parser.ts, the unquoted isTerminator branch doubles terminator in value mode as well as key mode (and !started in key mode does not skip ;), while needsQuotes and encodeTuple in src/builder/index.ts do not check for leading/trailing whitespace, leading '/", or = in keys.
Version: @tediousjs/connection-string 1.1.0 and master (76a5db3), Node.js v26.13.0.
Activity
dhensby commentedon Nov 18, 2026
Thanks for the report. This has been fixed in #299
github-actions commentedon Nov 18, 2026
🎉 This issue has been resolved in version 1.1.1 🎉
The release is available on:
Your semantic-release bot 📦🚀