6 Commits

Author SHA1 Message Date
ee87a6269e 1.0.11 2021-09-08 22:25:52 +02:00
2d76e799a4 fix(core): update 2021-09-08 22:25:52 +02:00
f24520ea89 1.0.10 2021-09-08 22:11:48 +02:00
5072728118 fix(core): update 2021-09-08 22:11:48 +02:00
bb4df0c47f 1.0.9 2021-09-08 21:49:40 +02:00
101533cddd fix(core): update 2021-09-08 21:49:40 +02:00
4 changed files with 2200 additions and 3486 deletions

5612
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartrouter", "name": "@pushrocks/smartrouter",
"version": "1.0.8", "version": "1.0.11",
"private": false, "private": false,
"description": "a router for routing on websites", "description": "a router for routing on websites",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
@ -13,7 +13,7 @@
"format": "(gitzone format)" "format": "(gitzone format)"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.26", "@gitzone/tsbuild": "^2.1.27",
"@gitzone/tsbundle": "^1.0.87", "@gitzone/tsbundle": "^1.0.87",
"@gitzone/tstest": "^1.0.57", "@gitzone/tstest": "^1.0.57",
"@pushrocks/tapbundle": "^3.2.14", "@pushrocks/tapbundle": "^3.2.14",

View File

@ -35,12 +35,12 @@ tap.test('should find a query param', async (toolsArg) => {
expect(routeInfoArg.params.wow).to.equal('hello2'); expect(routeInfoArg.params.wow).to.equal('hello2');
expect(routeInfoArg.queryParams.aparam).to.equal('Yes'); expect(routeInfoArg.queryParams.aparam).to.equal('Yes');
console.log('Here is what queryParams looks like'); console.log('Here is what queryParams looks like');
console.log(JSON.stringify(routeInfoArg.queryParams)) console.log(JSON.stringify(routeInfoArg.queryParams));
done.resolve(); done.resolve();
}); });
testrouter.pushUrl('/myawesomeroute2/hello2?aparam=Yes'); testrouter.pushUrl('/myawesomeroute2/hello2?aparam=Yes');
await done.promise; await done.promise;
expect(window.location.href).to.equal('http://localhost:3007/myawesomeroute2/hello2?aparam=Yes'); expect(window.location.href).to.equal('http://localhost:3007/myawesomeroute2/hello2?aparam=Yes');
}) });
tap.start(); tap.start();

View File

@ -92,7 +92,7 @@ export class SmartRouter {
const routeResult = wantedRoute.matchFunction(currentLocation); const routeResult = wantedRoute.matchFunction(currentLocation);
wantedRoute.handler({ wantedRoute.handler({
...(routeResult.valueOf() as Object), ...(routeResult.valueOf() as Object),
queryParams: Object.fromEntries(urlSearchParams.entries()), queryParams: Object.fromEntries((urlSearchParams as any).entries()), // TODO check wether entries is supported in typings
} as IRouteInfo); // not waiting here } as IRouteInfo); // not waiting here
} }
} }