mini-tools
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -22,3 +22,3 @@ import { Request, Response, NextFunction } from 'express'; | ||
}; | ||
export declare function serveErr(req: Request, res: Response, next: NextFunction): (err: AnyErrorDuck) => Promise<void>; | ||
export declare function serveErr(_req: Request, res: Response, next: NextFunction): (err: AnyErrorDuck) => Promise<void>; | ||
export declare type IdentsMap = { | ||
@@ -25,0 +25,0 @@ [key: string]: boolean; |
@@ -11,2 +11,3 @@ "use strict"; | ||
const send = require("send"); | ||
/* tslint:disable:no-object-literal-type-assertion */ | ||
exports.globalOpts = { | ||
@@ -26,3 +27,4 @@ serveErr: { | ||
}; | ||
function serveErr(req, res, next) { | ||
/* tslint:enable:no-object-literal-type-assertion */ | ||
function serveErr(_req, res, next) { | ||
return async function (err) { | ||
@@ -116,2 +118,3 @@ if (err.message === 'next') { | ||
else if (anyFileOrOptions == null) { | ||
/* istanbul ignore next */ | ||
anyFile = null; | ||
@@ -124,2 +127,3 @@ } | ||
} | ||
/* istanbul ignore next */ | ||
let traceRoute = renderOptions && renderOptions.trace ? 'serveContent>' + renderOptions.trace : (exports.globalOpts.logServe ? getTraceroute() : ''); | ||
@@ -171,9 +175,9 @@ if (extOriginal) { | ||
} | ||
await serveText(htmlText, textType)(req, res); | ||
serveText(htmlText, textType)(req, res); | ||
} | ||
catch (err) { | ||
serveErr(req, res, next)(err); | ||
await serveErr(req, res, next)(err); | ||
} | ||
} | ||
unchainedFunction(); | ||
void unchainedFunction(); | ||
}; | ||
@@ -224,3 +228,3 @@ } | ||
catch (err) { | ||
return await searchFileName(); | ||
return searchFileName(); | ||
} | ||
@@ -242,3 +246,3 @@ } | ||
else { | ||
return await exports.globalOpts.readConfig.exts[result.ext](result.fileName); | ||
return exports.globalOpts.readConfig.exts[result.ext](result.fileName); | ||
} | ||
@@ -245,0 +249,0 @@ } |
{ | ||
"name": "mini-tools", | ||
"description": "mini tools for express and others", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"author": "Codenautas <codenautas@googlegroups.com>", | ||
@@ -19,3 +19,3 @@ "license": "MIT", | ||
"fs-extra": "~7.0.1", | ||
"js-yaml": "~3.12.2", | ||
"js-yaml": "~3.13.0", | ||
"pug": "~2.0.3", | ||
@@ -25,3 +25,3 @@ "read-yaml-promise": "~1.0.2", | ||
"stylus": "~0.54.5", | ||
"best-globals": "~0.10.10", | ||
"best-globals": "~0.10.15", | ||
"lodash": "^4.17.11" | ||
@@ -34,3 +34,3 @@ }, | ||
"@types/mocha": "~5.2.6", | ||
"@types/node": "~11.10.4", | ||
"@types/node": "~11.12.2", | ||
"@types/send": "~0.14.4", | ||
@@ -42,7 +42,7 @@ "colors": "~1.3.3", | ||
"nyc": "~13.3.0", | ||
"sinon": "~7.2.6", | ||
"source-map-support": "~0.5.10", | ||
"supertest": "~3.4.2", | ||
"ts-node": "~8.0.2", | ||
"typescript": "~3.3.3333" | ||
"sinon": "~7.3.1", | ||
"source-map-support": "~0.5.11", | ||
"supertest": "~4.0.2", | ||
"ts-node": "~8.0.3", | ||
"typescript": "~3.4.1" | ||
}, | ||
@@ -55,3 +55,3 @@ "main": "lib/mini-tools.js", | ||
"scripts": { | ||
"tsc": "tsc", | ||
"build": "tsc", | ||
"test": "mocha --reporter spec --bail --check-leaks --exit test/", | ||
@@ -58,0 +58,0 @@ "test-ci": "node node_modules/nyc/bin/nyc --reporter=lcov --reporter=text-lcov node_modules/mocha/bin/_mocha --exit --check-leaks test/", |
@@ -13,3 +13,2 @@ # mini-tools | ||
[](https://david-dm.org/codenautas/mini-tools) | ||
[](http://codenautas.com/github/codenautas/mini-tools) | ||
@@ -16,0 +15,0 @@ |
Sorry, the diff of this file is not supported yet
27109
292
203
+ Addedjs-yaml@3.13.1(transitive)
- Removedjs-yaml@3.12.2(transitive)
Updatedbest-globals@~0.10.15
Updatedjs-yaml@~3.13.0