Skip to content

Commit 9eb32ca

Browse files
committed
[Fix] splitKeyIntoSegments: improve comment clarity on handling unterminated groups
1 parent 5205037 commit 9eb32ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/parse.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ var splitKeyIntoSegments = function splitKeyIntoSegments(originalKey, options) {
269269
}
270270

271271
if (close < 0) {
272-
// Unterminated group: wrap the raw remainder once as a single literal segment
272+
// Unterminated group: wrap the raw remainder in one bracket pair so it stays
273+
// a single literal segment (e.g. "[[]b" -> "[[]b]"); we do not infer missing ']'.
273274
segments[segments.length] = '[' + key.slice(open) + ']';
274275
return segments;
275276
}

0 commit comments

Comments
 (0)