tote-lib
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -184,27 +184,30 @@ 'use strict'; | ||
var _this = undefined; | ||
var invoke = (function (name, request) { return __awaiter(_this, void 0, void 0, function () { | ||
var path$1, func, context, _a, body, status; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
path$1 = path.resolve('src', name); | ||
return [4 /*yield*/, require(path$1).default | ||
// @ts-ignore | ||
]; | ||
case 1: | ||
func = _b.sent(); | ||
context = { | ||
res: {} | ||
}; | ||
return [4 /*yield*/, func(context, request)]; | ||
case 2: | ||
_b.sent(); | ||
_a = context.res, body = _a.body, status = _a.status; | ||
return [2 /*return*/, { | ||
body: body, | ||
status: status | ||
}]; | ||
} | ||
var invoke = (function (name, request) { | ||
if (request === void 0) { request = {}; } | ||
return __awaiter(_this, void 0, void 0, function () { | ||
var path$1, func, context, _a, body, status; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
path$1 = path.resolve('src', name); | ||
return [4 /*yield*/, require(path$1).default | ||
// @ts-ignore | ||
]; | ||
case 1: | ||
func = _b.sent(); | ||
context = { | ||
res: {} | ||
}; | ||
return [4 /*yield*/, func(context, request)]; | ||
case 2: | ||
_b.sent(); | ||
_a = context.res, body = _a.body, status = _a.status; | ||
return [2 /*return*/, { | ||
body: body, | ||
status: status | ||
}]; | ||
} | ||
}); | ||
}); | ||
}); }); | ||
}); | ||
@@ -211,0 +214,0 @@ exports.joi = joi; |
@@ -1,2 +0,7 @@ | ||
declare const _default: (name: string, request: any) => Promise<{ | ||
interface Request { | ||
body?: any; | ||
headers?: any; | ||
query?: any; | ||
} | ||
declare const _default: (name: string, request?: Request) => Promise<{ | ||
body: any; | ||
@@ -3,0 +8,0 @@ status: any; |
{ | ||
"name": "tote-lib", | ||
"license": "MIT", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
17454
398