@icarowhyy/pnpjs-query
v1.2.1
Published
OData query for JavaScript
Downloads
13
Maintainers
Readme
This library is intended to make it easier to write OData queries.
Overview
Features
- Semantic
- Typesafe
- Secure
Basic Usage
const query = new Query().eq("name", "Test").and().eq("age", 1).build();
/* output
name eq 'Test' and age eq 1
*/
const query = new Query().eq("name", "Test").or().eq("age", 1).build();
/* output
name eq 'Test' or age eq 1
*/
const query = new Query().contains("name", "Test").build();
/* output
contains(name, 'Test')
*/
const query = new Query().eq("age", 1).build();
/* output
age eq 1
*/
const query = new Query().eq("name", "Whyy").build();
/* output
name eq 'Whyy'
*/
const query = new Query().ge("name", "Test").build();
/* output
age ge 'Test'
*/
const query = new Query().ge("age", 10).build();
/* output
age ge 10
*/
const query = new Query().ge("createdAt", new Date()).build();
/* output
createdAt ge '2022-01-01T00:00:00.000Z'
*/
Install
npm i @icarowhyy/pnpjs-query
Contributing
We welcome contributions! To contribute to the project, get in touch.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Support
If you encounter any issues or have any questions, please open an issue on our GitHub repository.