express-fast-json-stringify 1.2.0 → 1.2.4
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/CHANGELOG.md +9 -0
- package/build/main/index.d.ts +1 -0
- package/build/main/index.js +2 -1
- package/build/main/lib/middleware.d.ts +5 -4
- package/build/main/lib/middleware.js +5 -4
- package/build/module/index.d.ts +1 -0
- package/build/module/index.js +2 -1
- package/build/module/lib/middleware.d.ts +5 -4
- package/build/module/lib/middleware.js +5 -4
- package/package.json +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.2.4](https://github.com/nigrosimone/express-fast-json-stringify/compare/v1.2.2...v1.2.4) (2024-09-29)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* del deps ([0e9e63a](https://github.com/nigrosimone/express-fast-json-stringify/commit/0e9e63af86e647815002079b1df5ca19ff6f7632))
|
|
11
|
+
|
|
12
|
+
### [1.2.2](https://github.com/nigrosimone/express-fast-json-stringify/compare/v1.2.0...v1.2.2) (2024-09-29)
|
|
13
|
+
|
|
5
14
|
## [1.2.0](https://github.com/nigrosimone/express-fast-json-stringify/compare/v1.1.4...v1.2.0) (2024-09-29)
|
|
6
15
|
|
|
7
16
|
|
package/build/main/index.d.ts
CHANGED
package/build/main/index.js
CHANGED
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./lib/middleware"), exports);
|
|
18
|
-
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLG1EQUFpQztBQUNqQywwQ0FBd0IifQ==
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { NextFunction, Request, Response } from 'express';
|
|
2
|
-
import { Schema } from 'fast-json-stringify';
|
|
3
|
-
export type { Schema } from 'fast-json-stringify';
|
|
2
|
+
import { Options, Schema } from 'fast-json-stringify';
|
|
3
|
+
export type { Schema, Options } from 'fast-json-stringify';
|
|
4
4
|
/**
|
|
5
5
|
* Set the schema
|
|
6
|
-
* @param {Schema} schema
|
|
6
|
+
* @param {Schema} schema The schema used to stringify values
|
|
7
|
+
* @param {Options} options The options to use (optional)
|
|
7
8
|
*
|
|
8
9
|
* Examples:
|
|
9
10
|
* ```ts
|
|
@@ -42,4 +43,4 @@ export type { Schema } from 'fast-json-stringify';
|
|
|
42
43
|
* });
|
|
43
44
|
* ```
|
|
44
45
|
*/
|
|
45
|
-
export declare const fastJsonSchema: (schema: Schema) => (_req: Request, res: Response, next: NextFunction) => void;
|
|
46
|
+
export declare const fastJsonSchema: (schema: Schema, options?: Options) => (_req: Request, res: Response, next: NextFunction) => void;
|
|
@@ -7,7 +7,8 @@ exports.fastJsonSchema = void 0;
|
|
|
7
7
|
const fast_json_stringify_1 = __importDefault(require("fast-json-stringify"));
|
|
8
8
|
/**
|
|
9
9
|
* Set the schema
|
|
10
|
-
* @param {Schema} schema
|
|
10
|
+
* @param {Schema} schema The schema used to stringify values
|
|
11
|
+
* @param {Options} options The options to use (optional)
|
|
11
12
|
*
|
|
12
13
|
* Examples:
|
|
13
14
|
* ```ts
|
|
@@ -46,11 +47,11 @@ const fast_json_stringify_1 = __importDefault(require("fast-json-stringify"));
|
|
|
46
47
|
* });
|
|
47
48
|
* ```
|
|
48
49
|
*/
|
|
49
|
-
const fastJsonSchema = (schema) => {
|
|
50
|
+
const fastJsonSchema = (schema, options) => {
|
|
50
51
|
if (!schema) {
|
|
51
52
|
throw new TypeError(`express-fast-json-stringify: invalid schema`);
|
|
52
53
|
}
|
|
53
|
-
const fjs = (0, fast_json_stringify_1.default)(schema);
|
|
54
|
+
const fjs = (0, fast_json_stringify_1.default)(schema, options);
|
|
54
55
|
return (_req, res, next) => {
|
|
55
56
|
/**
|
|
56
57
|
* Send JSON response.
|
|
@@ -71,4 +72,4 @@ const fastJsonSchema = (schema) => {
|
|
|
71
72
|
};
|
|
72
73
|
};
|
|
73
74
|
exports.fastJsonSchema = fastJsonSchema;
|
|
74
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
75
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWlkZGxld2FyZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvbWlkZGxld2FyZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFDQSw4RUFBZ0U7QUFJaEU7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBeUNHO0FBQ0ksTUFBTSxjQUFjLEdBQUcsQ0FBQyxNQUFjLEVBQUUsT0FBaUIsRUFBRSxFQUFFO0lBQ2xFLElBQUksQ0FBQyxNQUFNLEVBQUU7UUFDWCxNQUFNLElBQUksU0FBUyxDQUFDLDZDQUE2QyxDQUFDLENBQUM7S0FDcEU7SUFDRCxNQUFNLEdBQUcsR0FBRyxJQUFBLDZCQUFRLEVBQUMsTUFBTSxFQUFFLE9BQU8sQ0FBQyxDQUFDO0lBQ3RDLE9BQU8sQ0FBQyxJQUFhLEVBQUUsR0FBYSxFQUFFLElBQWtCLEVBQUUsRUFBRTtRQUMxRDs7Ozs7Ozs7V0FRRztRQUNILEdBQUcsQ0FBQyxRQUFRLEdBQUcsQ0FBQyxJQUFTLEVBQVksRUFBRTtZQUNyQyxJQUFJLENBQUMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxjQUFjLENBQUMsRUFBRTtnQkFDbEMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxjQUFjLEVBQUUsa0JBQWtCLENBQUMsQ0FBQzthQUNuRDtZQUNELE9BQU8sR0FBRyxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQztRQUM3QixDQUFDLENBQUM7UUFDRixJQUFJLEVBQUUsQ0FBQztJQUNULENBQUMsQ0FBQztBQUNKLENBQUMsQ0FBQztBQXZCVyxRQUFBLGNBQWMsa0JBdUJ6QiJ9
|
package/build/module/index.d.ts
CHANGED
package/build/module/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export * from './lib/middleware';
|
|
2
|
-
|
|
2
|
+
export * from './types';
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxrQkFBa0IsQ0FBQztBQUNqQyxjQUFjLFNBQVMsQ0FBQyJ9
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { NextFunction, Request, Response } from 'express';
|
|
2
|
-
import { Schema } from 'fast-json-stringify';
|
|
3
|
-
export type { Schema } from 'fast-json-stringify';
|
|
2
|
+
import { Options, Schema } from 'fast-json-stringify';
|
|
3
|
+
export type { Schema, Options } from 'fast-json-stringify';
|
|
4
4
|
/**
|
|
5
5
|
* Set the schema
|
|
6
|
-
* @param {Schema} schema
|
|
6
|
+
* @param {Schema} schema The schema used to stringify values
|
|
7
|
+
* @param {Options} options The options to use (optional)
|
|
7
8
|
*
|
|
8
9
|
* Examples:
|
|
9
10
|
* ```ts
|
|
@@ -42,4 +43,4 @@ export type { Schema } from 'fast-json-stringify';
|
|
|
42
43
|
* });
|
|
43
44
|
* ```
|
|
44
45
|
*/
|
|
45
|
-
export declare const fastJsonSchema: (schema: Schema) => (_req: Request, res: Response, next: NextFunction) => void;
|
|
46
|
+
export declare const fastJsonSchema: (schema: Schema, options?: Options) => (_req: Request, res: Response, next: NextFunction) => void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import fastJson from 'fast-json-stringify';
|
|
2
2
|
/**
|
|
3
3
|
* Set the schema
|
|
4
|
-
* @param {Schema} schema
|
|
4
|
+
* @param {Schema} schema The schema used to stringify values
|
|
5
|
+
* @param {Options} options The options to use (optional)
|
|
5
6
|
*
|
|
6
7
|
* Examples:
|
|
7
8
|
* ```ts
|
|
@@ -40,11 +41,11 @@ import fastJson from 'fast-json-stringify';
|
|
|
40
41
|
* });
|
|
41
42
|
* ```
|
|
42
43
|
*/
|
|
43
|
-
export const fastJsonSchema = (schema) => {
|
|
44
|
+
export const fastJsonSchema = (schema, options) => {
|
|
44
45
|
if (!schema) {
|
|
45
46
|
throw new TypeError(`express-fast-json-stringify: invalid schema`);
|
|
46
47
|
}
|
|
47
|
-
const fjs = fastJson(schema);
|
|
48
|
+
const fjs = fastJson(schema, options);
|
|
48
49
|
return (_req, res, next) => {
|
|
49
50
|
/**
|
|
50
51
|
* Send JSON response.
|
|
@@ -64,4 +65,4 @@ export const fastJsonSchema = (schema) => {
|
|
|
64
65
|
next();
|
|
65
66
|
};
|
|
66
67
|
};
|
|
67
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
68
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWlkZGxld2FyZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvbWlkZGxld2FyZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLFFBQTZCLE1BQU0scUJBQXFCLENBQUM7QUFJaEU7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBeUNHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sY0FBYyxHQUFHLENBQUMsTUFBYyxFQUFFLE9BQWlCLEVBQUUsRUFBRTtJQUNsRSxJQUFJLENBQUMsTUFBTSxFQUFFO1FBQ1gsTUFBTSxJQUFJLFNBQVMsQ0FBQyw2Q0FBNkMsQ0FBQyxDQUFDO0tBQ3BFO0lBQ0QsTUFBTSxHQUFHLEdBQUcsUUFBUSxDQUFDLE1BQU0sRUFBRSxPQUFPLENBQUMsQ0FBQztJQUN0QyxPQUFPLENBQUMsSUFBYSxFQUFFLEdBQWEsRUFBRSxJQUFrQixFQUFFLEVBQUU7UUFDMUQ7Ozs7Ozs7O1dBUUc7UUFDSCxHQUFHLENBQUMsUUFBUSxHQUFHLENBQUMsSUFBUyxFQUFZLEVBQUU7WUFDckMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxTQUFTLENBQUMsY0FBYyxDQUFDLEVBQUU7Z0JBQ2xDLEdBQUcsQ0FBQyxTQUFTLENBQUMsY0FBYyxFQUFFLGtCQUFrQixDQUFDLENBQUM7YUFDbkQ7WUFDRCxPQUFPLEdBQUcsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUM7UUFDN0IsQ0FBQyxDQUFDO1FBQ0YsSUFBSSxFQUFFLENBQUM7SUFDVCxDQUFDLENBQUM7QUFDSixDQUFDLENBQUMifQ==
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "express-fast-json-stringify",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "With express-fast-json-stringify, you can leverage fast-json-stringify in your Express application",
|
|
5
5
|
"main": "build/main/index.js",
|
|
6
6
|
"typings": "build/main/index.d.ts",
|
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"node": ">=18"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@bitauth/libauth": "^1.17.1",
|
|
49
48
|
"fast-json-stringify": "^6.0.0"
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|