Skip to content

Commit

Permalink
feat: first release
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadi Abu Hilal authored and Shadi Abu Hilal committed Jan 11, 2024
1 parent 8997d6b commit 7e4368e
Show file tree
Hide file tree
Showing 60 changed files with 1,146 additions and 18,360 deletions.
13 changes: 0 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +0,0 @@
## [1.0.1](https://github.com/shadiabuhilal/is-json-request/compare/v1.0.0...v1.0.1) (2023-12-10)


### Bug Fixes

* fix isJsonReq function to handle map headers object that is used in Next.JS ([451008e](https://github.com/shadiabuhilal/is-json-request/commit/451008e500e420dff4d791a6ba9ee56708df2e3a))

# 1.0.0 (2023-12-07)


### Features

* **first release:** first release ([c8042d8](https://github.com/shadiabuhilal/is-json-request/commit/c8042d89c15bf394407c8675344370c32941488d))
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Shadi Abu Hilal
Copyright (c) 2024 Shadi Abu Hilal

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
83 changes: 24 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,78 +1,43 @@
# is-json-request
![Build Status](https://github.com/shadiabuhilal/is-json-request/actions/workflows/push-workflows.yml/badge.svg)
# firestore-query-operators
![Build Status](https://github.com/shadiabuhilal/firestore-query-operators/actions/workflows/push-workflows.yml/badge.svg)

Check if the current request is json, express js, next js, any node js server side code. (supports module and commonJS).
Firestore query operators helper

https://shadiabuhilal.github.io/is-json-request/
https://shadiabuhilal.github.io/firestore-query-operators/

-----------

## Usage

### import is-json-request
### import firestore-query-operators
```js
import { isJsonReq, isGetReq, isPostReq, isPutReq, isDeleteReq } from 'is-json-request';
import { QueryOperators } from 'firestore-query-operators';
```

Or

### require is-json-request
### require firestore-query-operators
```js
const { isJsonReq, isGetReq, isPostReq, isPutReq, isDeleteReq } = require('is-json-request');
const { QueryOperators } = require('firestore-query-operators');
```

### isJsonReq
This function checks if the current request is a json request or not.
---

Example:
### Available Query Operations
Support query operations that used in firestore.

```js
if (isJsonReq(req)) {
// Is a JSON request
}
```

### isGetReq
This function checks if the current request is a http GET method request or not.
| Variable | Oprator | Description |
|-----|---------|--------------|
| QueryOperators.lessThan | < | less than |
| QueryOperators.lessThanOrEqualTo | <= | less than or equal to |
| QueryOperators.equalTo | == | equal to |
| QueryOperators.greaterThan | > | greater than |
| QueryOperators.greaterThanOrEqualTo | >= | greater than or equal to |
| QueryOperators.notEqualTo | != | not equal to |
| QueryOperators.arrayContains | array-contains | array contains |
| QueryOperators.arrayContainsAny | array-contains-any | array contains any |
| QueryOperators.in | in | in |
| QueryOperators.notIn | not-in | not-in |

Example:

```js
if (isGetReq(req)) {
// Is a HTTP GET method request
}
```

### isPostReq
This function checks if the current request is a http POST method request or not.

Example:

```js
if (isPostReq(req)) {
// Is a HTTP POST method request
}
```
[Firestore query operations doc](https://firebase.google.com/docs/firestore/query-data/queries).


### isPutReq
This function checks if the current request is a http PUT method request or not.

Example:

```js
if (isPutReq(req)) {
// Is a HTTP PUT method request
}
```

### isDeleteReq
This function checks if the current request is a http DELETE method request or not.

Example:

```js
if (isDeleteReq(req)) {
// Is a HTTP DELETE method request
}
```
Binary file removed docs/fonts/Montserrat/Montserrat-Bold.eot
Binary file not shown.
Binary file removed docs/fonts/Montserrat/Montserrat-Bold.ttf
Binary file not shown.
Binary file removed docs/fonts/Montserrat/Montserrat-Bold.woff
Binary file not shown.
Binary file removed docs/fonts/Montserrat/Montserrat-Bold.woff2
Binary file not shown.
Binary file removed docs/fonts/Montserrat/Montserrat-Regular.eot
Binary file not shown.
Binary file removed docs/fonts/Montserrat/Montserrat-Regular.ttf
Binary file not shown.
Binary file removed docs/fonts/Montserrat/Montserrat-Regular.woff
Binary file not shown.
Binary file removed docs/fonts/Montserrat/Montserrat-Regular.woff2
Binary file not shown.
Binary file removed docs/fonts/OpenSans-Bold-webfont.eot
Binary file not shown.
1,830 changes: 0 additions & 1,830 deletions docs/fonts/OpenSans-Bold-webfont.svg

This file was deleted.

Binary file removed docs/fonts/OpenSans-Bold-webfont.woff
Binary file not shown.
Binary file removed docs/fonts/OpenSans-BoldItalic-webfont.eot
Binary file not shown.
1,830 changes: 0 additions & 1,830 deletions docs/fonts/OpenSans-BoldItalic-webfont.svg

This file was deleted.

Binary file removed docs/fonts/OpenSans-BoldItalic-webfont.woff
Binary file not shown.
Binary file removed docs/fonts/OpenSans-Italic-webfont.eot
Binary file not shown.
1,830 changes: 0 additions & 1,830 deletions docs/fonts/OpenSans-Italic-webfont.svg

This file was deleted.

Binary file removed docs/fonts/OpenSans-Italic-webfont.woff
Binary file not shown.
Binary file removed docs/fonts/OpenSans-Light-webfont.eot
Binary file not shown.
1,831 changes: 0 additions & 1,831 deletions docs/fonts/OpenSans-Light-webfont.svg

This file was deleted.

Binary file removed docs/fonts/OpenSans-Light-webfont.woff
Binary file not shown.
Binary file removed docs/fonts/OpenSans-LightItalic-webfont.eot
Binary file not shown.
1,835 changes: 0 additions & 1,835 deletions docs/fonts/OpenSans-LightItalic-webfont.svg

This file was deleted.

Binary file removed docs/fonts/OpenSans-LightItalic-webfont.woff
Binary file not shown.
Binary file removed docs/fonts/OpenSans-Regular-webfont.eot
Binary file not shown.
1,831 changes: 0 additions & 1,831 deletions docs/fonts/OpenSans-Regular-webfont.svg

This file was deleted.

Binary file removed docs/fonts/OpenSans-Regular-webfont.woff
Binary file not shown.
Binary file not shown.
978 changes: 0 additions & 978 deletions docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1,049 changes: 0 additions & 1,049 deletions docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 7e4368e

Please sign in to comment.