spooder 4.4.6 → 4.4.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/api.ts +3 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "spooder",
3
3
  "type": "module",
4
- "version": "4.4.6",
4
+ "version": "4.4.7",
5
5
  "exports": {
6
6
  ".": {
7
7
  "bun": "./src/api.ts",
package/src/api.ts CHANGED
@@ -400,7 +400,7 @@ export async function db_init_schema_mysql(db_info: mysql_types.ConnectionOption
400
400
  return await _db_init_schema_mysql(db_info, schema_dir, false) as mysql_types.Connection;
401
401
  }
402
402
 
403
- type CookieOptions = {
403
+ export type CookieOptions = {
404
404
  same_site?: 'Strict' | 'Lax' | 'None',
405
405
  secure?: boolean,
406
406
  http_only?: boolean,
@@ -547,7 +547,7 @@ function route_directory(route_path: string, dir: string, handler: DirHandler):
547
547
  };
548
548
  }
549
549
 
550
- export function validate_req_json(JSONRequestHandler: JSONRequestHandler): RequestHandler {
550
+ export function validate_req_json(json_handler: JSONRequestHandler): RequestHandler {
551
551
  return async (req: Request, url: URL) => {
552
552
  try {
553
553
  // validate content type header
@@ -560,7 +560,7 @@ export function validate_req_json(JSONRequestHandler: JSONRequestHandler): Reque
560
560
  if (json === null || typeof json !== 'object' || Array.isArray(json))
561
561
  return 400; // Bad Request
562
562
 
563
- return JSONRequestHandler(req, url, json);
563
+ return json_handler(req, url, json);
564
564
  } catch (e) {
565
565
  return 400; // Bad Request
566
566
  }