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.
Files changed (2) hide show
  1. package/lieko-express.js +11 -0
  2. 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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lieko-express",
3
- "version": "1.0.2",
3
+ "version": "1.0.22",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/eiwSrvt/lieko-express"