@silenteer/natsu
Advanced tools
Comparing version 1.0.19 to 1.0.20
@@ -221,3 +221,3 @@ "use strict"; | ||
const handleInjection = Object.assign(Object.assign({}, injection), { ok: (params) => { | ||
const { headers, body } = params; | ||
const { headers, body } = params || {}; | ||
return { | ||
@@ -229,3 +229,3 @@ code: 'OK', | ||
}, error: (params) => { | ||
const { code = 500, errors } = params; | ||
const { code = 500, errors } = params || {}; | ||
return { | ||
@@ -232,0 +232,0 @@ code, |
@@ -77,3 +77,3 @@ import type { Msg, NatsConnection, PublishOptions, RequestOptions } from 'nats'; | ||
ok: () => NatsValidationResult; | ||
error: (params: { | ||
error: (params?: { | ||
code?: number; | ||
@@ -85,3 +85,3 @@ errors: unknown; | ||
ok: () => NatsAuthorizationResult; | ||
error: (params: { | ||
error: (params?: { | ||
code?: number; | ||
@@ -92,4 +92,4 @@ errors: unknown; | ||
declare type NatsHandleInjection<TService extends NatsService<string, unknown, unknown>, TInjection extends Record<string, unknown> = Record<string, unknown>> = NatsInjection<TService, TInjection> & { | ||
ok: (params: Pick<NatsHandleResult<TService>, 'headers' | 'body'>) => NatsHandleResult<TService>; | ||
error: (params: { | ||
ok: (params?: Pick<NatsHandleResult<TService>, 'headers' | 'body'>) => NatsHandleResult<TService>; | ||
error: (params?: { | ||
code?: number; | ||
@@ -96,0 +96,0 @@ errors: unknown; |
{ | ||
"name": "@silenteer/natsu", | ||
"version": "1.0.19", | ||
"version": "1.0.20", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "private": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72421