@balena/odata-parser
Advanced tools
Comparing version 3.1.3-build-renovate-major-11-mocha-feefe2bf46fe207099c4e7779b469205f51f4189-1 to 4.0.0-build-compile-in-as-eq-any-26f07fff3659a9a21fca2a20a392ee956861a0bc-1
@@ -7,6 +7,6 @@ # Change Log | ||
# v3.1.3 | ||
## (2024-12-02) | ||
# v4.0.0 | ||
## (2025-01-20) | ||
* Update dependency mocha to v11 [Self-hosted Renovate Bot] | ||
* feat: compile odata `in` to a abstract sql `eq any $listBind` [Otavio Jacobi] | ||
@@ -13,0 +13,0 @@ # v3.1.2 |
{ | ||
"name": "@balena/odata-parser", | ||
"version": "3.1.3-build-renovate-major-11-mocha-feefe2bf46fe207099c4e7779b469205f51f4189-1", | ||
"version": "4.0.0-build-compile-in-as-eq-any-26f07fff3659a9a21fca2a20a392ee956861a0bc-1", | ||
"description": "An OData parser written in OMeta", | ||
@@ -26,3 +26,3 @@ "main": "odata-parser.js", | ||
"lodash": "^4.17.21", | ||
"mocha": "^11.0.0", | ||
"mocha": "^10.7.3", | ||
"peggy": "^4.1.1", | ||
@@ -43,4 +43,4 @@ "ts-node": "^10.9.2", | ||
"versionist": { | ||
"publishedAt": "2024-12-02T16:52:18.961Z" | ||
"publishedAt": "2025-01-20T13:19:35.095Z" | ||
} | ||
} |
@@ -242,61 +242,97 @@ import * as assert from 'assert'; | ||
test('$filter=Price in (1, 2, 3)', [1, 2, 3], function (result) { | ||
it('A filter should be present', () => { | ||
assert.notEqual(result.options.$filter, null); | ||
}); | ||
test( | ||
'$filter=Price in (1, 2, 3)', | ||
[ | ||
[ | ||
'List', | ||
[ | ||
['Real', 1], | ||
['Real', 2], | ||
['Real', 3], | ||
], | ||
], | ||
], | ||
function (result) { | ||
it('A filter should be present', () => { | ||
assert.notEqual(result.options.$filter, null); | ||
}); | ||
it("Filter should be an instance of 'in'", () => { | ||
assert.equal(result.options.$filter[0], 'in'); | ||
}); | ||
it("Filter should be an instance of 'eq'", () => { | ||
assert.equal(result.options.$filter[0], 'eq'); | ||
}); | ||
it('lhr should be Price', () => { | ||
assert.equal(result.options.$filter[1].name, 'Price'); | ||
}); | ||
it('lhr should be Price', () => { | ||
assert.equal(result.options.$filter[1].name, 'Price'); | ||
}); | ||
it('rhr should be [ $1, $2, $3 ]', function () { | ||
assert.equal(result.options.$filter[2][0].bind, 0); | ||
assert.equal(result.options.$filter[2][1].bind, 1); | ||
assert.equal(result.options.$filter[2][2].bind, 2); | ||
}); | ||
}); | ||
it(`rhr should be ['any', $1 ]`, function () { | ||
assert.equal(result.options.$filter[2][0], 'any'); | ||
assert.equal(result.options.$filter[2][1].bind, 0); | ||
}); | ||
}, | ||
); | ||
test('$filter=Price in ((1), ((2)), (((3))))', [1, 2, 3], function (result) { | ||
it('A filter should be present', () => { | ||
assert.notEqual(result.options.$filter, null); | ||
}); | ||
test( | ||
'$filter=Price in ((1), ((2)), (((3))))', | ||
[ | ||
[ | ||
'List', | ||
[ | ||
['Real', 1], | ||
['Real', 2], | ||
['Real', 3], | ||
], | ||
], | ||
], | ||
function (result) { | ||
it('A filter should be present', () => { | ||
assert.notEqual(result.options.$filter, null); | ||
}); | ||
it("Filter should be an instance of 'in'", () => { | ||
assert.equal(result.options.$filter[0], 'in'); | ||
}); | ||
it("Filter should be an instance of 'eq'", () => { | ||
assert.equal(result.options.$filter[0], 'eq'); | ||
}); | ||
it('lhr should be Price', () => { | ||
assert.equal(result.options.$filter[1].name, 'Price'); | ||
}); | ||
it('lhr should be Price', () => { | ||
assert.equal(result.options.$filter[1].name, 'Price'); | ||
}); | ||
it('rhr should be [ $1, $2, $3 ]', function () { | ||
assert.equal(result.options.$filter[2][0].bind, 0); | ||
assert.equal(result.options.$filter[2][1].bind, 1); | ||
assert.equal(result.options.$filter[2][2].bind, 2); | ||
}); | ||
}); | ||
it(`rhr should be ['any', $1 ]`, function () { | ||
assert.equal(result.options.$filter[2][0], 'any'); | ||
assert.equal(result.options.$filter[2][1].bind, 0); | ||
}); | ||
}, | ||
); | ||
test("$filter=Price in ('a', 'b', 'c')", ['a', 'b', 'c'], function (result) { | ||
it('A filter should be present', () => { | ||
assert.notEqual(result.options.$filter, null); | ||
}); | ||
test( | ||
"$filter=Price in ('a', 'b', 'c')", | ||
[ | ||
[ | ||
'List', | ||
[ | ||
['Text', 'a'], | ||
['Text', 'b'], | ||
['Text', 'c'], | ||
], | ||
], | ||
], | ||
function (result) { | ||
it('A filter should be present', () => { | ||
assert.notEqual(result.options.$filter, null); | ||
}); | ||
it("Filter should be an instance of 'in'", () => { | ||
assert.equal(result.options.$filter[0], 'in'); | ||
}); | ||
it("Filter should be an instance of 'eq'", () => { | ||
assert.equal(result.options.$filter[0], 'eq'); | ||
}); | ||
it('lhr should be Price', () => { | ||
assert.equal(result.options.$filter[1].name, 'Price'); | ||
}); | ||
it('lhr should be Price', () => { | ||
assert.equal(result.options.$filter[1].name, 'Price'); | ||
}); | ||
it('rhr should be [ $1, $2, $3 ]', function () { | ||
assert.equal(result.options.$filter[2][0].bind, 0); | ||
assert.equal(result.options.$filter[2][1].bind, 1); | ||
assert.equal(result.options.$filter[2][2].bind, 2); | ||
}); | ||
}); | ||
it(`rhr should be ['any', $1 ]`, function () { | ||
assert.equal(result.options.$filter[2][0], 'any'); | ||
assert.equal(result.options.$filter[2][1].bind, 0); | ||
}); | ||
}, | ||
); | ||
@@ -303,0 +339,0 @@ test('$filter=Price add 5 gt 10', [5, 10], function (result) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
252614
6629