New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@axah/koa

Package Overview
Dependencies
Maintainers
10
Versions
154
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@axah/koa - npm Package Compare versions

Comparing version 0.0.0-20240606141354 to 0.0.0-20240606143136

3

lib/create-api-method/index.d.ts

@@ -12,2 +12,3 @@ import type { Context, Middleware, Next } from 'koa';

hashAlgorithm?: string;
errorFormatter?: (...params: any[]) => any;
};

@@ -23,3 +24,3 @@ type ExecutorInput<B, Q, P> = {

type Executor<B, Q, P> = (input: ExecutorInput<B, Q, P>) => Promise<void> | void;
export default function createApiMethod<BodyIn, QueryIn, ParamsIn, BodyOut, QueryOut, ParamsOut>({ allowedRoles, body: bodyValidator, query: queryValidator, params: paramsValidator, files: allowFiles, exposeErrorCause, hashAlgorithm, }: Input<ZodType<BodyOut, ZodTypeDef, BodyIn>, ZodType<QueryOut, ZodTypeDef, QueryIn>, ZodType<ParamsOut, ZodTypeDef, ParamsIn>>, executor: Executor<BodyOut, QueryOut, ParamsOut>, errorFormatter?: (...params: any[]) => any): Middleware;
export default function createApiMethod<BodyIn, QueryIn, ParamsIn, BodyOut, QueryOut, ParamsOut>({ allowedRoles, body: bodyValidator, query: queryValidator, params: paramsValidator, files: allowFiles, exposeErrorCause, hashAlgorithm, errorFormatter, }: Input<ZodType<BodyOut, ZodTypeDef, BodyIn>, ZodType<QueryOut, ZodTypeDef, QueryIn>, ZodType<ParamsOut, ZodTypeDef, ParamsIn>>, executor: Executor<BodyOut, QueryOut, ParamsOut>): Middleware;
export {};

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

};
function createApiMethod({ allowedRoles, body: bodyValidator, query: queryValidator, params: paramsValidator, files: allowFiles = false, exposeErrorCause = false, hashAlgorithm, }, executor, errorFormatter) {
function createApiMethod({ allowedRoles, body: bodyValidator, query: queryValidator, params: paramsValidator, files: allowFiles = false, exposeErrorCause = false, hashAlgorithm, errorFormatter = undefined, }, executor) {
const parseBody = (0, koa_body_1.default)({

@@ -34,3 +34,2 @@ json: true,

if (errorFormatter) {
ctx.log.info(errorFormatter);
errorFormatter(ctx, http_status_codes_1.StatusCodes.FORBIDDEN, http_status_codes_1.ReasonPhrases.FORBIDDEN, e);

@@ -37,0 +36,0 @@ }

{
"name": "@axah/koa",
"version": "0.0.0-20240606141354",
"version": "0.0.0-20240606143136",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "license": "UNLICENSED",

Sorry, the diff of this file is not supported yet

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