spooder 4.4.2 → 4.4.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 +1 -1
- package/package.json +1 -1
- package/src/api.ts +3 -3
package/README.md
CHANGED
|
@@ -734,7 +734,7 @@ server.route('/api/endpoint', async (req, url) => {
|
|
|
734
734
|
As you can see this is quite verbose and adds a lot of boilerplate to your handlers. `validate_req_json` can be used to simplify this.
|
|
735
735
|
|
|
736
736
|
```ts
|
|
737
|
-
server.route('/api/endpoint', validate_req_json(async (
|
|
737
|
+
server.route('/api/endpoint', validate_req_json(async (req, url, json) => {
|
|
738
738
|
// do something with json.
|
|
739
739
|
return 200;
|
|
740
740
|
}));
|
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -463,10 +463,10 @@ type Resolvable<T> = T | Promise<T>;
|
|
|
463
463
|
type PromiseType<T extends Promise<any>> = T extends Promise<infer U> ? U : never;
|
|
464
464
|
|
|
465
465
|
// The following types cover JSON serializable objects/classes.
|
|
466
|
-
type JsonPrimitive = string | number | boolean | null;
|
|
467
|
-
type JsonArray = JsonSerializable[];
|
|
466
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
467
|
+
export type JsonArray = JsonSerializable[];
|
|
468
468
|
|
|
469
|
-
interface JsonObject {
|
|
469
|
+
export interface JsonObject {
|
|
470
470
|
[key: string]: JsonSerializable;
|
|
471
471
|
}
|
|
472
472
|
|