revojs 0.2.1 → 0.2.3

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/dist/package.js CHANGED
@@ -1,6 +1,6 @@
1
1
  //#region package.json
2
2
  var name = "revojs";
3
- var version = "0.2.1";
3
+ var version = "0.2.3";
4
4
  var repository = {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/tellua/revojs.git"
@@ -27,6 +27,7 @@ var exports = {
27
27
  };
28
28
  var scripts = {
29
29
  "build": "vite build",
30
+ "test": "node --test tests/*.test.mjs",
30
31
  "typecheck": "tsc --noEmit -p tsconfig.json",
31
32
  "watch": "vite build --watch"
32
33
  };
@@ -109,7 +109,8 @@ var Router = class {
109
109
  return context;
110
110
  }
111
111
  async resolve(scope, segments) {
112
- const result = await getContext(scope, ROUTE_RESOLVER_CONTEXT)?.(segments);
112
+ const resolver = getContext(scope, ROUTE_RESOLVER_CONTEXT);
113
+ const result = typeof resolver === "function" ? await resolver(segments) : segments;
113
114
  return setContext(scope, ROUTE_CONTEXT, result ? this.match(result) : {
114
115
  segments,
115
116
  parameters: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revojs",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,6 +34,7 @@
34
34
  },
35
35
  "scripts": {
36
36
  "build": "vite build",
37
+ "test": "node --test tests/*.test.mjs",
37
38
  "typecheck": "tsc --noEmit -p tsconfig.json",
38
39
  "watch": "vite build --watch"
39
40
  },