@e22m4u/js-trie-router 0.7.8 → 0.7.9

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/README.md CHANGED
@@ -969,7 +969,7 @@ v1Branch.defineRoute({
969
969
  // GET /api/v1/status
970
970
  ```
971
971
 
972
- ## Обработка ошибок
972
+ ### Обработка ошибок
973
973
 
974
974
  Маршрутизатор автоматически перехватывает любые ошибки, выброшенные из хуков
975
975
  или обработчика маршрута. По умолчанию, любая ошибка приводит к ответу сервера
@@ -1035,16 +1035,16 @@ router.defineRoute({
1035
1035
  }
1036
1036
  ```
1037
1037
 
1038
- ### Перехват и логирование ошибок
1038
+ #### Перехват и логирование ошибок
1039
1039
 
1040
1040
  По умолчанию маршрутизатор не выводит информацию об ошибках в консоль,
1041
1041
  чтобы не нарушать формат логов приложения и не допускать утечки чувствительных
1042
1042
  данных (например, токенов из заголовков запроса).
1043
1043
 
1044
- Если требуется реализовать собственное логирование ошибок, то можно
1045
- переопределить встроенный сервис `RouterErrorSender`. Для этого потребуется
1046
- унаследовать класс данного сервиса и подменить стандартную реализацию
1047
- в контейнере маршрутизатора.
1044
+ Если требуется реализовать собственное логирование, то можно переопределить
1045
+ встроенный сервис `RouterErrorSender`. Для этого потребуется унаследовать
1046
+ класс данного сервиса и подменить стандартную реализацию в контейнере
1047
+ маршрутизатора.
1048
1048
 
1049
1049
  ```js
1050
1050
  import {TrieRouter, RouterErrorSender} from '@e22m4u/js-trie-router';
@@ -98,7 +98,7 @@ var DebuggableService = class extends import_js_service.DebuggableService {
98
98
  constructor(container = void 0) {
99
99
  super(container, {
100
100
  namespace: MODULE_DEBUG_NAMESPACE,
101
- noEnvironmentNamespace: true
101
+ noGlobalNamespace: true
102
102
  });
103
103
  }
104
104
  };
@@ -1670,7 +1670,7 @@ var Route = class extends import_js_debug.Debuggable {
1670
1670
  constructor(routeDef) {
1671
1671
  super({
1672
1672
  namespace: MODULE_DEBUG_NAMESPACE,
1673
- noEnvironmentNamespace: true,
1673
+ noGlobalNamespace: true,
1674
1674
  noInstantiationMessage: true
1675
1675
  });
1676
1676
  validateRouteDefinition(routeDef);
@@ -1688,7 +1688,7 @@ var Route = class extends import_js_debug.Debuggable {
1688
1688
  this._hookRegistry.addHook(RouterHookType.POST_HANDLER, hook);
1689
1689
  });
1690
1690
  }
1691
- this.ctorDebug("Created a route %s %v.", this.method, this.path);
1691
+ this.ctorDebug("Route %s %v created.", this.method, this.path);
1692
1692
  }
1693
1693
  /**
1694
1694
  * Handle request.
@@ -1758,7 +1758,7 @@ var RouteRegistry = class extends DebuggableService {
1758
1758
  const route = new Route(routeDef);
1759
1759
  const triePath = `${route.method}/${route.path}`;
1760
1760
  this._trie.add(triePath, route);
1761
- debug("Registered a route %s %v.", route.method.toUpperCase(), route.path);
1761
+ debug("Route %s %v registered.", route.method.toUpperCase(), route.path);
1762
1762
  return route;
1763
1763
  }
1764
1764
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e22m4u/js-trie-router",
3
- "version": "0.7.8",
3
+ "version": "0.7.9",
4
4
  "description": "HTTP маршрутизатор для Node.js на основе префиксного дерева",
5
5
  "author": "Mikhail Evstropov <e22m4u@yandex.ru>",
6
6
  "license": "MIT",
@@ -38,17 +38,17 @@
38
38
  "prepare": "husky"
39
39
  },
40
40
  "dependencies": {
41
- "@e22m4u/js-debug": "~0.4.1",
41
+ "@e22m4u/js-debug": "~0.5.0",
42
42
  "@e22m4u/js-format": "~0.4.0",
43
- "@e22m4u/js-path-trie": "~0.2.0",
44
- "@e22m4u/js-service": "~0.6.1",
43
+ "@e22m4u/js-path-trie": "~0.2.1",
44
+ "@e22m4u/js-service": "~0.6.2",
45
45
  "debug": "~4.4.3",
46
46
  "http-errors": "~2.0.1",
47
47
  "statuses": "~2.0.2"
48
48
  },
49
49
  "devDependencies": {
50
- "@commitlint/cli": "~20.4.3",
51
- "@commitlint/config-conventional": "~20.4.3",
50
+ "@commitlint/cli": "~20.4.4",
51
+ "@commitlint/config-conventional": "~20.4.4",
52
52
  "@eslint/js": "~9.39.2",
53
53
  "@types/chai": "~5.2.3",
54
54
  "@types/chai-as-promised": "~8.0.2",
@@ -56,12 +56,12 @@
56
56
  "c8": "~11.0.0",
57
57
  "chai": "~6.2.2",
58
58
  "chai-as-promised": "~8.0.2",
59
- "esbuild": "~0.27.3",
59
+ "esbuild": "~0.27.4",
60
60
  "eslint": "~9.39.2",
61
61
  "eslint-config-prettier": "~10.1.8",
62
- "eslint-plugin-chai-expect": "~3.1.0",
62
+ "eslint-plugin-chai-expect": "~4.0.0",
63
63
  "eslint-plugin-import": "~2.32.0",
64
- "eslint-plugin-jsdoc": "~62.7.1",
64
+ "eslint-plugin-jsdoc": "~62.8.0",
65
65
  "eslint-plugin-mocha": "~11.2.0",
66
66
  "globals": "~17.4.0",
67
67
  "husky": "~9.1.7",
@@ -21,7 +21,7 @@ export class DebuggableService extends BaseDebuggableService {
21
21
  constructor(container = undefined) {
22
22
  super(container, {
23
23
  namespace: MODULE_DEBUG_NAMESPACE,
24
- noEnvironmentNamespace: true,
24
+ noGlobalNamespace: true,
25
25
  });
26
26
  }
27
27
  }
@@ -78,7 +78,7 @@ export class RouteRegistry extends DebuggableService {
78
78
  const route = new Route(routeDef);
79
79
  const triePath = `${route.method}/${route.path}`;
80
80
  this._trie.add(triePath, route);
81
- debug('Registered a route %s %v.', route.method.toUpperCase(), route.path);
81
+ debug('Route %s %v registered.', route.method.toUpperCase(), route.path);
82
82
  return route;
83
83
  }
84
84
 
@@ -127,7 +127,7 @@ export class Route extends Debuggable {
127
127
  constructor(routeDef) {
128
128
  super({
129
129
  namespace: MODULE_DEBUG_NAMESPACE,
130
- noEnvironmentNamespace: true,
130
+ noGlobalNamespace: true,
131
131
  noInstantiationMessage: true,
132
132
  });
133
133
  validateRouteDefinition(routeDef);
@@ -151,7 +151,7 @@ export class Route extends Debuggable {
151
151
  this._hookRegistry.addHook(RouterHookType.POST_HANDLER, hook);
152
152
  });
153
153
  }
154
- this.ctorDebug('Created a route %s %v.', this.method, this.path);
154
+ this.ctorDebug('Route %s %v created.', this.method, this.path);
155
155
  }
156
156
 
157
157
  /**