@balena/odata-parser
Advanced tools
Comparing version 3.1.0 to 3.1.1-build-avoid-unnecessary-1f3e69085a7e4225c648ea55a594895c288c45e2-1
@@ -7,2 +7,8 @@ # Change Log | ||
# v3.1.1 | ||
## (2024-10-04) | ||
* Avoid setting `property`/`count`/`options` for expands when not provided [Pagan Gazzard] | ||
* Avoid setting nested `property` for `PropertyPath` when not provided [Pagan Gazzard] | ||
# v3.1.0 | ||
@@ -9,0 +15,0 @@ ## (2024-10-03) |
{ | ||
"name": "@balena/odata-parser", | ||
"version": "3.1.0", | ||
"version": "3.1.1-build-avoid-unnecessary-1f3e69085a7e4225c648ea55a594895c288c45e2-1", | ||
"description": "An OData parser written in OMeta", | ||
@@ -42,4 +42,4 @@ "main": "odata-parser.js", | ||
"versionist": { | ||
"publishedAt": "2024-10-03T19:30:42.294Z" | ||
"publishedAt": "2024-10-04T15:26:18.354Z" | ||
} | ||
} |
import * as assert from 'assert'; | ||
import { expect } from 'chai'; | ||
import $test from './test'; | ||
@@ -26,5 +27,10 @@ import filterby from './filterby'; | ||
}); | ||
it('should not have a nested property on Suppliers', () => { | ||
expect( | ||
result.options.$expand.properties[0].property, | ||
).to.not.have.property('property'); | ||
}); | ||
}); | ||
test('$expand=Products,Suppliers', function (result) { | ||
test('$expand=Products,Suppliers()', function (result) { | ||
it('has an $expand value', () => { | ||
@@ -36,5 +42,25 @@ assert.notEqual(result.options.$expand, null); | ||
}); | ||
it('not have count set on Products', () => { | ||
expect(result.options.$expand.properties[0]).to.not.have.property( | ||
'count', | ||
); | ||
}); | ||
it('not have options set on Products', () => { | ||
expect(result.options.$expand.properties[0]).to.not.have.property( | ||
'options', | ||
); | ||
}); | ||
it('should not have a nested property on Products', () => { | ||
expect(result.options.$expand.properties[0]).to.not.have.property( | ||
'property', | ||
); | ||
}); | ||
it('has a resource of Suppliers', () => { | ||
assert.equal(result.options.$expand.properties[1].name, 'Suppliers'); | ||
}); | ||
it('not have options set on Suppliers', () => { | ||
expect(result.options.$expand.properties[1]).to.not.have.property( | ||
'options', | ||
); | ||
}); | ||
}); | ||
@@ -41,0 +67,0 @@ |
@@ -285,2 +285,6 @@ import resourceTest from './test'; | ||
it('lhr should not have a property', () => { | ||
expect(result.options.$filter[1]).to.not.have.property('property'); | ||
}); | ||
it('rhr should be $0', () => { | ||
@@ -287,0 +291,0 @@ assert.equal(result.options.$filter[2].bind, 0); |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
250493
6508
2