openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
25 lines (24 loc) • 697 B
JavaScript
import { o as normalizeLowercaseStringOrEmpty } from "./string-coerce-CCIiB4H7.mjs";
//#region src/shared/text/auto-linked-file-ref.ts
const FILE_REF_EXTENSIONS = [
"md",
"go",
"py",
"pl",
"sh",
"am",
"at",
"be",
"cc"
];
const FILE_REF_EXTENSIONS_WITH_TLD = new Set(FILE_REF_EXTENSIONS);
function isAutoLinkedFileRef(e, t) {
if (e.replace(/^https?:\/\//i, "") !== t) return false;
const n = t.lastIndexOf(".");
if (n < 1) return false;
const r = normalizeLowercaseStringOrEmpty(t.slice(n + 1));
if (!FILE_REF_EXTENSIONS_WITH_TLD.has(r)) return false;
return t.indexOf(".") > t.lastIndexOf("/");
}
//#endregion
export { isAutoLinkedFileRef as n, FILE_REF_EXTENSIONS_WITH_TLD as t };