@fedify/fedify 1.6.0-dev.775 → 1.6.0-dev.776

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.
@@ -9,7 +9,11 @@ export class Router {
9
9
  #router;
10
10
  #templates;
11
11
  #templateStrings;
12
- #trailingSlashInsensitive;
12
+ /**
13
+ * Whether to ignore trailing slashes when matching paths.
14
+ * @since 1.6.0
15
+ */
16
+ trailingSlashInsensitive;
13
17
  /**
14
18
  * Create a new {@link Router}.
15
19
  * @param options Options for the router.
@@ -18,7 +22,7 @@ export class Router {
18
22
  this.#router = new InnerRouter();
19
23
  this.#templates = {};
20
24
  this.#templateStrings = {};
21
- this.#trailingSlashInsensitive = options.trailingSlashInsensitive ?? false;
25
+ this.trailingSlashInsensitive = options.trailingSlashInsensitive ?? false;
22
26
  }
23
27
  /**
24
28
  * Checks if a path name exists in the router.
@@ -52,7 +56,7 @@ export class Router {
52
56
  route(url) {
53
57
  let match = this.#router.resolveURI(url);
54
58
  if (match == null) {
55
- if (!this.#trailingSlashInsensitive)
59
+ if (!this.trailingSlashInsensitive)
56
60
  return null;
57
61
  url = url.endsWith("/") ? url.replace(/\/+$/, "") : `${url}/`;
58
62
  match = this.#router.resolveURI(url);