Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
ee87a6269e | |||
2d76e799a4 | |||
f24520ea89 | |||
5072728118 | |||
bb4df0c47f | |||
101533cddd |
5612
package-lock.json
generated
5612
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -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",
|
||||||
|
@ -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();
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user