fix(core): update

This commit is contained in:
2022-12-31 11:21:29 +01:00
parent 470f47f8bb
commit 41b6f04db6
14 changed files with 4438 additions and 27455 deletions

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@pushrocks/smartrouter',
version: '1.0.13',
description: 'a router for routing on websites'
}

View File

@ -1 +1 @@
export * from './smartrouter.classes.smartrouter';
export * from './smartrouter.classes.smartrouter.js';

View File

@ -1,4 +1,4 @@
import * as plugins from './smartrouter.plugins';
import * as plugins from './smartrouter.plugins.js';
export class QueryParams {
constructor() {}
@ -8,7 +8,11 @@ export class QueryParams {
return Object.fromEntries((urlSearchParams as any).entries());
}
public setQueryParam(queryKeyArg: string, queryContentArg: string, pushOrReplaceArg: 'push' | 'replace' = 'replace') {
public setQueryParam(
queryKeyArg: string,
queryContentArg: string,
pushOrReplaceArg: 'push' | 'replace' = 'replace'
) {
var queryParams = new URLSearchParams(window.location.search);
queryParams.set(queryKeyArg, queryContentArg);
pushOrReplaceArg === 'push'

View File

@ -1,8 +1,8 @@
import * as plugins from './smartrouter.plugins';
import * as plugins from './smartrouter.plugins.js';
import { QueryParams } from './smartrouter.classes.queryparams';
import { QueryParams } from './smartrouter.classes.queryparams.js';
const routeLog = (message) => {
const routeLog = (message: string) => {
console.log(`%c[Router]%c ${message}`, 'color: rgb(255, 105, 100);', 'color: inherit');
};
@ -85,7 +85,6 @@ export class SmartRouter {
*/
async _handleRouteState() {
const currentLocation = window.location.pathname;
// lets find all wanted routes.
const wantedRoutes = this.routes.filter((routeArg) => {
@ -100,6 +99,4 @@ export class SmartRouter {
} as IRouteInfo); // not waiting here
}
}
}