fix(core): update
This commit is contained in:
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal 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'
|
||||
}
|
@ -1 +1 @@
|
||||
export * from './smartrouter.classes.smartrouter';
|
||||
export * from './smartrouter.classes.smartrouter.js';
|
||||
|
@ -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'
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user