From 6c4072ca29dac65d1d22193227d45df1565d3b16 Mon Sep 17 00:00:00 2001 From: ATATC Date: Wed, 28 Jun 2023 19:25:03 -0400 Subject: [PATCH] Version `1.0.3`. Bug fixed. --- package.json | 2 +- src/redirect.ts | 4 ++-- src/types.ts | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 965d27a..f14b896 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@atatctech/redirect", "type": "module", - "version": "1.0.3", + "version": "1.0.4", "author": "ATATC", "description": "A lightweight redirecting tool.", "keywords": [ diff --git a/src/redirect.ts b/src/redirect.ts index 2ece8c9..d21f3f0 100644 --- a/src/redirect.ts +++ b/src/redirect.ts @@ -1,4 +1,4 @@ -import {Args, RedirectFunction} from "./types"; +import {Args} from "./types"; export function excludeParams(href: string): string { return href.substring(0, href.indexOf("?")); @@ -37,7 +37,7 @@ function Redirect(url?: string, args: Args = {}): void { } } -export function useRedirect(): RedirectFunction { +export function useRedirect(): (url?: string, args?: Args) => void { return Redirect; } diff --git a/src/types.ts b/src/types.ts index c792abf..cf4e99b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,2 +1 @@ -export type Args = {params?: {[key: string]: string}, blank?: boolean, refresh?: boolean}; -export type RedirectFunction = (url?: string, args?: Args) => void; \ No newline at end of file +export type Args = {params?: {[key: string]: string}, blank?: boolean, refresh?: boolean}; \ No newline at end of file