添加短信验证服务
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-04-18 08:48:04 +00:00
parent 7ce61e9879
commit 680b9a3e1c
14 changed files with 321 additions and 60 deletions

View File

@@ -151,9 +151,23 @@ async function main() {
process.on('SIGTERM', shutdown);
}
const isEntryPoint =
typeof process.argv[1] === 'string' &&
import.meta.url === pathToFileURL(process.argv[1]).href;
function isEntryModule() {
if (typeof process.argv[1] !== 'string') {
return false;
}
const entryHref = pathToFileURL(process.argv[1]).href;
if (typeof import.meta.url === 'string' && import.meta.url === entryHref) {
return true;
}
return (
typeof __filename === 'string' &&
pathToFileURL(__filename).href === entryHref
);
}
const isEntryPoint = isEntryModule();
if (isEntryPoint) {
void main().catch((error) => {