Comments (7)
Hey @jgornick !
Glad you're using ODataFilterBuilder
!
I will fix it soon.
Have You tried esModuleInterop from typescript 2.7?
It should fix Your issue for now.
With this option your import should be:
import ODataFilterBuilder from 'odata-filter-builder';
from odata-filter-builder.
Nice! Haven't been able to upgrade yet to 2.7.x, but will give this a try when I can upgrade. If I have some time, I'll first look into providing a PR with the fix.
Thanks!
from odata-filter-builder.
Published version 1.0.0-0
with updated export:
odata-filter-builder/src/ODataFilterBuilder.js
Lines 234 to 240 in a129a68
Could be installed via
> npm install odata-filter-builder@next
from odata-filter-builder.
With ts we have one more issue:
TypeError: Class constructor ODataFilterBuilder cannot be invoked without 'new'
Mb will drop support of ODataFilterBuilder
without new
.
@jgornick what do You think?
from odata-filter-builder.
Externally, sure it makes sense to not support a consumer creating a new instance of ODataFilterBuilder.
Another option would be to allow the creation of new instances and then having "static" methods to create a new instance of ODataFilterBuilder:
const fb: ODataFilterBuilder = ODataFilterBuilder.and();
// or
const fb: ODataFilterBuilder = ODataFilterBuilder.or();
Thoughts?
from odata-filter-builder.
Static methods for creating (and
and or
) are already available
https://github.com/bodia-uz/odata-filter-builder/blob/v1.0.0-0/src/ODataFilterBuilder.js#L230-L231
But the documentation for them could be better.
Currently, doc says to use:
const fb: ODataFilterBuilder = ODataFilterBuilder();
fb.eq('x', 1);
Need to depracate old format and update doc with:
const fb: ODataFilterBuilder = new ODataFilterBuilder();
// or
const fb: ODataFilterBuilder = ODataFilterBuilder.and();
// or
const fb: ODataFilterBuilder = ODataFilterBuilder.or();
fb.eq('x', 1);
Or/And mb add factory functions to module export:
import { and, or } from "odata-filter-builder";
// import { createAnd, createOr } from "odata-filter-builder";
const fb: ODataFilterBuilder = and();
// or
const fb: ODataFilterBuilder = or();
from odata-filter-builder.
@bodia-uz This is looking awesome! I like the ability to just use and()
or or()
as factory methods. Awesome stuff!
from odata-filter-builder.
Related Issues (12)
- Support ES5 HOT 5
- Support for any lambda operator HOT 4
- Convert wrap in parenthesis (grouping) to an operator? HOT 3
- Percent encoding of filter values HOT 3
- How to send UID (eg 24221e2b-16e4-29b3-bb6c-bgb4fa724915) without quotes? HOT 2
- Empty values (null, undefined) in 'contains' method HOT 3
- Add ability to check if filter is empty
- Add ability to check if object is instance of ODataFilterBuilder
- SubstringOf HOT 2
- ODataV4 Datetime filters not supported HOT 1
- Dependency Dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from odata-filter-builder.