The parser is returning the correct number of items in the items array, but duplicates the first value twice. So we end up with a result of [foo, foo] instead of [foo, bar].
Here's a failing test that demonstrates this:
it('should parse multiple orderby params', () => {
var parser = new Parser();
var ast = parser.query("$orderby=foo,bar");
console.log(ast.value.options[0].value.items);
expect(ast.value.options[0].value.items[0].raw).to.equal('foo');
expect(ast.value.options[0].value.items[1].raw).to.equal('bar');
});
Given a querystring param of:
$orderby=foo,bar
The parser is returning the correct number of items in the items array, but duplicates the first value twice. So we end up with a result of
[foo, foo]
instead of[foo, bar]
.Here's a failing test that demonstrates this:
and here's the output of that test: