refac: export getDefaultParam
This commit is contained in:
@@ -3,7 +3,7 @@ import { useEffect, useState } from "preact/hooks";
|
||||
import "@/global.css";
|
||||
|
||||
import { calculate_token_length } from "@/chatgpt";
|
||||
import getDefaultParams from "@/utils/getDefaultParam";
|
||||
import { getDefaultParams } from "@/utils/getDefaultParam";
|
||||
import ChatBOX from "@/chatbox";
|
||||
import { DefaultModel } from "@/const";
|
||||
import { Tr, langCodeContext, LANG_OPTIONS } from "@/translate";
|
||||
|
||||
@@ -43,7 +43,7 @@ import {
|
||||
import Message from "@/message";
|
||||
import { models } from "@/types/models";
|
||||
import Settings from "@/settings";
|
||||
import getDefaultParams from "@/utils/getDefaultParam";
|
||||
import { getDefaultParams } from "@/utils/getDefaultParam";
|
||||
import { AddImage } from "@/addImage";
|
||||
import { ListAPIs } from "@/listAPIs";
|
||||
import { ListToolsTempaltes } from "@/listToolsTemplates";
|
||||
|
||||
@@ -33,7 +33,7 @@ import { tr, Tr, langCodeContext, LANG_OPTIONS } from "@/translate";
|
||||
import { isVailedJSON } from "@/message";
|
||||
import { SetAPIsTemplate } from "@/setAPIsTemplate";
|
||||
import { autoHeight } from "@/textarea";
|
||||
import getDefaultParams from "@/utils/getDefaultParam";
|
||||
import { getDefaultParams } from "@/utils/getDefaultParam";
|
||||
|
||||
const TTS_VOICES: string[] = [
|
||||
"alloy",
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { Logprobs, Message } from "@/chatgpt";
|
||||
import { DefaultModel, CHATGPT_API_WEB_VERSION } from "@/const";
|
||||
import getDefaultParams from "@/utils/getDefaultParam";
|
||||
|
||||
/**
|
||||
* ChatStore is the main object of the chatgpt-api-web,
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
DefaultModel,
|
||||
CHATGPT_API_WEB_VERSION,
|
||||
} from "@/const";
|
||||
import getDefaultParams from "@/utils/getDefaultParam";
|
||||
import { getDefaultParams } from "@/utils/getDefaultParam";
|
||||
import { ChatStore } from "@/types/chatstore";
|
||||
import { models } from "@/types/models";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
function getDefaultParams(param: string, val: string): string;
|
||||
function getDefaultParams(param: string, val: number): number;
|
||||
function getDefaultParams(param: string, val: boolean): boolean;
|
||||
export function getDefaultParams(param: string, val: string): string;
|
||||
export function getDefaultParams(param: string, val: number): number;
|
||||
export function getDefaultParams(param: string, val: boolean): boolean;
|
||||
|
||||
function getDefaultParams(param: any, val: any) {
|
||||
export function getDefaultParams(param: any, val: any) {
|
||||
const queryParameters = new URLSearchParams(window.location.search);
|
||||
const get = queryParameters.get(param);
|
||||
if (typeof val === "string") {
|
||||
@@ -17,5 +17,3 @@ function getDefaultParams(param: any, val: any) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
export default getDefaultParams;
|
||||
|
||||
Reference in New Issue
Block a user