This repository has been archived by the owner on Sep 19, 2022. It is now read-only.
Make module buildable; deal better with missing properties #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
package.json
The odata-v4-inmemory module would not build because the format of the *.d.ts file had changed with the newer typescript that was used to build the requirement module odata-v4-parser. Updated both the typescript version and the minimum version of odata-v4-parser. Not sure if it was necessary to update the latter, but it should not hurt.
test/filterVistor.test.js:
Once I was able to get the module to build, there were four tests that were failing. Disabled them because they were failing before I changed anything.
src/FilterVisitor.ts
Updated function VisitODataIdentifier so it can deal better with properties that are undefined. At the point at which this function is called, a property could be set to null, but it could also be undefined. In order for filtering and sorting to work properly in those cases, the code now forces a return of null if the property is undefined (rather than returning undefined). This enables queries like the following to return the expected result:
http:///odata/worker?$filter=strProperty eq null
NOTE: in the system I am working with, the OData service is querying micro-services to get their data. They return json when null properties are not included. Hence VisitODataIdentier would return undefined when they were accessed.