This repository has been archived on 2026-03-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openclaw-extensions/wecom/node_modules/node-llama-cpp/dist/utils/isUrl.js
T

15 lines
432 B
JavaScript

export function isUrl(text, throwOnInvalidUrl = true) {
if (text.toLowerCase().startsWith("http://") || text.toLowerCase().startsWith("https://")) {
try {
new URL(text);
return true;
}
catch {
if (throwOnInvalidUrl)
throw new Error(`Invalid URL: ${text}`);
return false;
}
}
return false;
}
//# sourceMappingURL=isUrl.js.map