Skip to content

Commit

Permalink
Merge pull request #290 from TBXark/dev
Browse files Browse the repository at this point in the history
fix: 配置中bool类型判断错误BUG
  • Loading branch information
TBXark authored Sep 19, 2024
2 parents 0094e5a + e0b3424 commit 65ba46b
Show file tree
Hide file tree
Showing 7 changed files with 790 additions and 489 deletions.
2 changes: 1 addition & 1 deletion dist/buildinfo.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 5 additions & 25 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/timestamp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "chatgpt-telegram-workers",
"type": "module",
"version": "1.9.3",
"version": "1.9.4",
"description": "The easiest and quickest way to deploy your own ChatGPT Telegram bot is to use a single file and simply copy and paste it. There is no need for any dependencies, local development environment configuration, domain names, or servers.",
"author": "tbxark <[email protected]>",
"license": "MIT",
Expand Down Expand Up @@ -35,26 +35,27 @@
"start:local": "CONFIG_PATH=./config.json TOML_PATH=./wrangler.toml tsx src/adapter/local/index.ts",
"start:debug": "wrangler dev --local",
"prepare:vercel": "tsx ./scripts/plugins/vercel/setenv.ts",
"wrangler": "wrangler"
"wrangler": "wrangler",
"test": "tsx ./src/config/env.test.ts"
},
"dependencies": {
"cloudflare-worker-adapter": "^1.3.3"
},
"devDependencies": {
"@antfu/eslint-config": "^3.0.0",
"@antfu/eslint-config": "^3.6.2",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/node": "^22.5.3",
"@vercel/node": "^3.2.11",
"eslint": "^9.8.0",
"@types/node": "^22.5.5",
"@vercel/node": "^3.2.14",
"eslint": "^9.10.0",
"eslint-plugin-format": "^0.1.2",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-node-externals": "^7.1.3",
"telegram-bot-api-types": "^7.9.12",
"tsx": "^4.19.0",
"typescript": "^5.5.4",
"tsx": "^4.19.1",
"typescript": "^5.6.2",
"vite": "^5.4.3",
"vite-plugin-checker": "^0.7.2",
"vite-plugin-dts": "^4.1.0",
"wrangler": "^3.74.0"
"vite-plugin-checker": "^0.8.0",
"vite-plugin-dts": "^4.2.1",
"wrangler": "^3.78.5"
}
}
4 changes: 2 additions & 2 deletions src/config/env.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { parse } from 'toml';
import { ENV } from './env';

{
const toml = readFileSync('../../wrangler.toml', 'utf8');
const toml = readFileSync('./wrangler.toml', 'utf8');
const config = parse(toml);
ENV.merge({
...config.vars,
DATABASE: {},
});
// console.log(JSON.stringify(ENV, null, 2));
console.log(JSON.stringify(ENV, null, 2));
}
2 changes: 1 addition & 1 deletion src/config/merger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class ConfigMerger {
continue;
}
// 默认为字符串类型
const t = target[key] ? typeof target[key] : 'string';
const t = (target[key] !== null && target[key] !== undefined) ? typeof target[key] : 'string';
// 不是字符串直接赋值
if (typeof source[key] !== 'string') {
target[key] = source[key];
Expand Down
Loading

0 comments on commit 65ba46b

Please sign in to comment.