Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

18h

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

18h - npm Package Compare versions

Comparing version 3.0.11 to 3.0.12

8

dist/util/routes.js

@@ -30,3 +30,3 @@ "use strict";

const handlerResolver = (context, next) => __awaiter(void 0, void 0, void 0, function* () {
var _a, _b;
var _a, _b, _c;
const nextIfMiddlewareExist = () => {

@@ -45,3 +45,3 @@ if (post.length)

const response = yield handler(context);
const responseValidation = yield schema.response.safeParseAsync("body" in response ? response.body : "");
const responseValidation = yield schema.response.safeParseAsync("body" in response ? response.body : null);
if (!responseValidation.success) {

@@ -52,4 +52,4 @@ console.warn(errors_1.Errors.RESPONSE_MISMATCH);

}
context.body = responseValidation.data;
context.status = (_b = response.status) !== null && _b !== void 0 ? _b : 200;
context.body = (_b = responseValidation.data) !== null && _b !== void 0 ? _b : undefined;
context.status = (_c = response.status) !== null && _c !== void 0 ? _c : 200;
for (const [key, value] of Object.entries(response.headers || {}))

@@ -56,0 +56,0 @@ context.set(key, value.toString());

@@ -58,3 +58,3 @@ import Router from "koa-router";

const responseValidation = await schema.response.safeParseAsync(
"body" in response ? response.body : ""
"body" in response ? response.body : null
);

@@ -68,3 +68,3 @@

context.body = responseValidation.data;
context.body = responseValidation.data ?? undefined;
context.status = response.status ?? 200;

@@ -71,0 +71,0 @@

{
"name": "18h",
"description": "A Next.js style dynamic API router for Koa-based APIs.",
"version": "3.0.11",
"version": "3.0.12",
"repository": {

@@ -6,0 +6,0 @@ "url": "https://github.com/ridafkih/18h"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc