File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ t.test("empty object returns empty array", async () => {
1010 t . same ( extractStringsFromUserInput ( { } ) , fromArr ( [ ] ) ) ;
1111} ) ;
1212
13+ t . test ( "empty strings are ignored" , async ( ) => {
14+ t . same ( extractStringsFromUserInput ( { abc : "" } ) , fromArr ( [ "abc" ] ) ) ;
15+ } ) ;
16+
1317t . test ( "it can extract query objects" , async ( ) => {
1418 t . same (
1519 extractStringsFromUserInput ( { age : { $gt : "21" } } ) ,
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ export function extractStringsFromUserInput(
4242 results . add ( obj . join ( ) ) ;
4343 }
4444
45- if ( typeof obj === "string" ) {
45+ if ( typeof obj === "string" && obj . length > 0 ) {
4646 results . add ( obj ) ;
4747
4848 if ( obj . includes ( "%" ) && obj . length >= 3 ) {
You can’t perform that action at this time.
0 commit comments