lieko-express 1.0.2 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lieko-express.js +11 -0
- package/package.json +1 -1
package/lieko-express.js
CHANGED
|
@@ -449,6 +449,17 @@ class LiekoExpress {
|
|
|
449
449
|
all(path, ...handlers) { return this._call('all', path, handlers); },
|
|
450
450
|
|
|
451
451
|
use(pathOrMw, ...rest) {
|
|
452
|
+
|
|
453
|
+
if (Array.isArray(pathOrMw)) {
|
|
454
|
+
pathOrMw.forEach(p => {
|
|
455
|
+
if (typeof p !== 'string') {
|
|
456
|
+
throw new Error('group.use() array must contain only strings');
|
|
457
|
+
}
|
|
458
|
+
this.use(p, ...rest);
|
|
459
|
+
});
|
|
460
|
+
return subApp;
|
|
461
|
+
}
|
|
462
|
+
|
|
452
463
|
if (typeof pathOrMw === 'object' && pathOrMw instanceof LiekoExpress) {
|
|
453
464
|
const finalPath = fullBase === '/' ? '/' : fullBase;
|
|
454
465
|
parent.use(finalPath, ...middlewares, pathOrMw);
|