fix: #3207 ensure corner case

This commit is contained in:
Yidadaa 2023-11-10 15:15:43 +08:00
parent e6b72ac1ff
commit cb140e482f
2 changed files with 4 additions and 2 deletions

View File

@ -138,7 +138,7 @@ Azure Api 版本,你可以在这里找到:[Azure 文档](https://learn.micro
OPENAI_API_KEY=<your api key here> OPENAI_API_KEY=<your api key here>
# 中国大陆用户,可以使用本项目自带的代理进行开发,你也可以自由选择其他代理地址 # 中国大陆用户,可以使用本项目自带的代理进行开发,你也可以自由选择其他代理地址
BASE_URL=https://nb.nextweb.fun/api/proxy BASE_URL=https://ab.nextweb.fun/api/proxy
``` ```
### 本地开发 ### 本地开发

View File

@ -6,5 +6,7 @@ export function ensure<T extends object>(
obj: T, obj: T,
keys: Array<[keyof T][number]>, keys: Array<[keyof T][number]>,
) { ) {
return keys.every((k) => obj[k] !== undefined && obj[k] !== null); return keys.every(
(k) => obj[k] !== undefined && obj[k] !== null && obj[k] !== "",
);
} }