Skip to content

Commit

Permalink
v0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrodger committed Nov 27, 2023
1 parent 6b0d55d commit 9f6c9f4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions dist/gateway-express.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/gateway-express.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seneca/gateway-express",
"version": "0.9.0",
"version": "0.10.0",
"main": "dist/gateway-express.js",
"type": "commonjs",
"types": "dist/gateway-express.d.ts",
Expand Down Expand Up @@ -40,15 +40,15 @@
"devDependencies": {
"@seneca/maintain": "^0.1.0",
"@types/jest": "^29.5.10",
"esbuild": "^0.19.7",
"esbuild": "^0.19.8",
"esbuild-jest": "^0.5.0",
"express": "^4.17.1",
"jest": "^29.7.0",
"seneca-msg-test": "^3.4.0",
"typescript": "^5.3.2"
},
"peerDependencies": {
"@seneca/gateway": ">=0.8.0",
"@seneca/gateway": ">=0.9.0",
"express": ">=4",
"seneca": ">=3",
"seneca-promisify": ">=3"
Expand Down
4 changes: 2 additions & 2 deletions src/gateway-express.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function gateway_express(this: any, options: GatewayExpressOptions) {

if (gateway$.next) {
// Uses the default express error handler
return next(result.error ? result.out.error$ : undefined)
return next(result.error ? result.out : undefined)
}

// Should be last as final action
Expand All @@ -128,7 +128,7 @@ function gateway_express(this: any, options: GatewayExpressOptions) {

if (result.error) {
if (options.error?.next) {
return next(result.error ? result.out.error$ : undefined)
return next(result.error ? result.out : undefined)
}
else {
res.status(gateway$.status || 500)
Expand Down
4 changes: 1 addition & 3 deletions test/gateway-express.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ describe('gateway-express', () => {
}

await handler(req, res, (err: any, _req: any, _res: any, _next: any) => {
// console.log(err)

expect(err).toMatchObject({
name: 'Error',
code: 'act_not_found',
Expand Down Expand Up @@ -156,7 +154,7 @@ describe('gateway-express', () => {

expect(responses.length).toEqual(1)

expect(responses[0].error$).toEqual({
expect(responses[0]).toMatchObject({
code: 'act_not_found',
name: 'Error'
})
Expand Down

0 comments on commit 9f6c9f4

Please sign in to comment.