@esmx/router 3.0.0-rc.17 → 3.0.0-rc.18

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/package.json CHANGED
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "@biomejs/biome": "1.9.4",
37
- "@esmx/lint": "3.0.0-rc.17",
37
+ "@esmx/lint": "3.0.0-rc.18",
38
38
  "@gez/lint": "3.0.0-rc.9",
39
39
  "@types/node": "22.13.10",
40
40
  "@types/url-parse": "^1.4.11",
@@ -44,7 +44,7 @@
44
44
  "unbuild": "2.0.0",
45
45
  "vitest": "3.0.8"
46
46
  },
47
- "version": "3.0.0-rc.17",
47
+ "version": "3.0.0-rc.18",
48
48
  "type": "module",
49
49
  "private": false,
50
50
  "exports": {
@@ -63,5 +63,5 @@
63
63
  "template",
64
64
  "public"
65
65
  ],
66
- "gitHead": "5304ac6ef7a3b5d3bcb2db59cceb3f35723c2409"
66
+ "gitHead": "79ceb323f985dd88dbd7f1349f61f341b6d522c4"
67
67
  }
@@ -176,8 +176,7 @@ function createRouteMatches(
176
176
  ...createRouteMatch(
177
177
  {
178
178
  ...route,
179
- path:
180
- route.path instanceof Array ? route.path : [route.path]
179
+ path: Array.isArray(route.path) ? route.path : [route.path]
181
180
  },
182
181
  parent
183
182
  )
@@ -201,7 +200,7 @@ function createRouteMatch(
201
200
  route: RouteConfig,
202
201
  parent?: RouteMatch
203
202
  ): RouteMatch | RouteMatch[] {
204
- const pathList = route.path instanceof Array ? route.path : [route.path];
203
+ const pathList = Array.isArray(route.path) ? route.path : [route.path];
205
204
  const routeMatches: RouteMatch[] = pathList.reduce<RouteMatch[]>(
206
205
  (acc, item, index) => {
207
206
  const { children } = route;
@@ -287,7 +286,7 @@ function createRouteMatch(
287
286
  },
288
287
  []
289
288
  );
290
- return route.path instanceof Array
289
+ return Array.isArray(route.path)
291
290
  ? routeMatches
292
291
  : routeMatches[routeMatches.length - 1];
293
292
  }
@@ -22,7 +22,7 @@ export class Tasks<T extends func = func> {
22
22
  protected handlers: T[] = [];
23
23
 
24
24
  public add(handler: T | T[]) {
25
- const params: T[] = handler instanceof Array ? handler : [handler];
25
+ const params: T[] = Array.isArray(handler) ? handler : [handler];
26
26
  this.handlers.push(...params);
27
27
  }
28
28