payload-guard-filter 1.8.1 → 1.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# payload-guard
|
|
1
|
+
# payload-guard-filter
|
|
2
2
|
|
|
3
3
|
> Part of the [Professional Node.js Backend Toolkit](https://github.com/sannuk79/PROJECTS-AND-NPM-PACKAGES-)
|
|
4
4
|
|
|
@@ -45,7 +45,7 @@ graph LR
|
|
|
45
45
|
## 📦 Installation
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
npm install payload-guard
|
|
48
|
+
npm install payload-guard-filter
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
---
|
|
@@ -55,7 +55,7 @@ npm install payload-guard
|
|
|
55
55
|
### Basic Usage
|
|
56
56
|
|
|
57
57
|
```typescript
|
|
58
|
-
import { guard } from 'payload-guard';
|
|
58
|
+
import { guard } from 'payload-guard-filter';
|
|
59
59
|
|
|
60
60
|
// Define a shape
|
|
61
61
|
const userShape = guard.shape({
|
|
@@ -158,7 +158,7 @@ const userShape = guard.shape({
|
|
|
158
158
|
});
|
|
159
159
|
|
|
160
160
|
// Collect validation errors
|
|
161
|
-
const { compile } = require('payload-guard');
|
|
161
|
+
const { compile } = require('payload-guard-filter');
|
|
162
162
|
const errors = [];
|
|
163
163
|
const validator = compile(
|
|
164
164
|
{ email: { type: 'string', email: true } },
|
|
@@ -209,7 +209,7 @@ Creates a string builder with chained constraints:
|
|
|
209
209
|
|
|
210
210
|
**Error Collection:**
|
|
211
211
|
```typescript
|
|
212
|
-
const { compile } = require('payload-guard');
|
|
212
|
+
const { compile } = require('payload-guard-filter');
|
|
213
213
|
const errors = [];
|
|
214
214
|
const validator = compile(shape, { collectErrors: true, _errors: errors });
|
|
215
215
|
validator(data);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payload-guard-filter",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.3",
|
|
4
4
|
"description": "Lightweight, zero-dependency shape-based payload filtering and sanitization for Node.js and browser",
|
|
5
5
|
"author": "sannuk792",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
38
38
|
"build:types": "tsc -p tsconfig.types.json",
|
|
39
39
|
"clean": "rimraf dist",
|
|
40
|
-
"prepublishOnly": "npm run clean && npm run build",
|
|
40
|
+
"prepublishOnly": "npm run clean && npm run build && npm run test",
|
|
41
41
|
"test": "vitest run",
|
|
42
42
|
"test:watch": "vitest",
|
|
43
43
|
"test:coverage": "vitest run --coverage",
|
|
@@ -59,7 +59,6 @@
|
|
|
59
59
|
"trim",
|
|
60
60
|
"sensitive"
|
|
61
61
|
],
|
|
62
|
-
"author": "",
|
|
63
62
|
"license": "MIT",
|
|
64
63
|
"sideEffects": false,
|
|
65
64
|
"engines": {
|
|
@@ -90,4 +89,4 @@
|
|
|
90
89
|
"url": "https://mypackagedoc.vercel.app/package/payload-guard-filter"
|
|
91
90
|
},
|
|
92
91
|
"homepage": "https://mypackagedoc.vercel.app/package/payload-guard-filter"
|
|
93
|
-
}
|
|
92
|
+
}
|