diff --git a/packages/github/src/search.ts b/packages/github/src/search.ts index 546582d..41df96c 100644 --- a/packages/github/src/search.ts +++ b/packages/github/src/search.ts @@ -20,6 +20,7 @@ export function splitQueries(search: string): string[] { query = ""; } else if (c === '"') { quoted = !quoted; + query += c; } else { query += c; } diff --git a/packages/github/tests/search.test.ts b/packages/github/tests/search.test.ts index db6515b..cf6a315 100644 --- a/packages/github/tests/search.test.ts +++ b/packages/github/tests/search.test.ts @@ -128,7 +128,8 @@ test("split a search string into queries", () => { expect(splitQueries("a")).toEqual(["a"]); expect(splitQueries("a;b")).toEqual(["a", "b"]); expect(splitQueries(" a ; b ")).toEqual(["a", "b"]); - expect(splitQueries('"a;b";c')).toEqual(["a;b", "c"]); + expect(splitQueries(`"a"`)).toEqual([`"a"`]); + expect(splitQueries(`"a;b";c`)).toEqual([`"a;b"`, "c"]); expect(splitQueries("a; ;c")).toEqual(["a", "c"]); });