Skip to content

Commit fbd9b63

Browse files
committed
fix: Fix bug parsing "!-" in AQF syntax
1 parent 1d4eb28 commit fbd9b63

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/JsonURL.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ UNESCAPE[CHAR_PAREN_OPEN] = "(";
115115
UNESCAPE[CHAR_PAREN_CLOSE] = ")";
116116
UNESCAPE[CHAR_PLUS] = "+";
117117
UNESCAPE[CHAR_COMMA] = ",";
118-
UNESCAPE[CHAR_DASH] = ",";
118+
UNESCAPE[CHAR_DASH] = "-";
119119
UNESCAPE[CHAR_0] = "0";
120120
UNESCAPE[CHAR_0 + 1] = "1";
121121
UNESCAPE[CHAR_0 + 2] = "2";

test/parse.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ test.each([
117117
["%48%45%4C%4C%4F%21,+%57%4F%52%4C%44!!", "HELLO, WORLD!"],
118118
["%28%61%3A%62%2C%63%3A%64%29", { a: "b", c: "d" }],
119119
["%28%61%2C%62%2C%63%2c%64%29", ["a", "b", "c", "d"]],
120+
["(text:!-1)", { text: "-1" }],
120121
])("JsonURL.parse(%s)", (text, expected) => {
121122
expect(u.parse(text, { AQF: true })).toEqual(expected);
122123
expect(JsonURL.parse(text, { AQF: true })).toEqual(expected);

0 commit comments

Comments
 (0)