decord/alpha/source/modules/coded_links/findCodedLinkUrls.native.tsx

34 lines
1.1 KiB
TypeScript
Raw Normal View History

2026-10-06 11:16:32 +00:00
// Module ID: 4882
// Function ID: 4883
2026-08-25 06:04:03 +00:00
// Name: findCodedLinkUrls
2026-10-06 11:16:32 +00:00
// Dependencies: [4883, 7659, 5792, 13675, 13676, 2]
2026-08-25 06:04:03 +00:00
// Exports: default
2026-10-06 11:16:32 +00:00
// Module 4882 (findCodedLinkUrls)
import MarkupTypes from "MarkupTypes" /* 5792 */;
import findCodedLinkUrlsUsingRegexDefault from "findCodedLinkUrlsUsingRegex" /* 13676 */;
import size from "module_2" /* 2 */;
2026-08-25 06:04:03 +00:00
const result = size.fileFinishedImporting("modules/coded_links/findCodedLinkUrls.native.tsx");
2026-08-25 06:04:03 +00:00
export default function findCodedLinkUrls(content) {
2026-10-03 08:58:59 +00:00
let items;
let tmp = items;
2026-10-06 11:16:32 +00:00
const obj = items(13675);
2026-08-25 06:04:03 +00:00
if (obj.isFindCodedLinksRegexEnabled()) {
2026-10-03 08:58:59 +00:00
items = findCodedLinkUrlsUsingRegexDefault(content);
2026-08-25 06:04:03 +00:00
} else {
items = [];
2026-10-06 11:16:32 +00:00
const _default = tmp(4883).default;
2026-10-03 08:58:59 +00:00
const parseToASTResult = _default.parseToAST(content, true, { allowLinks: true });
2026-10-06 11:16:32 +00:00
const tmpResult = tmp(7659);
2026-10-03 08:58:59 +00:00
tmpResult.walkAst(parseToASTResult, (type) => {
const tmp = type.type === MarkupTypes.AST_KEY.LINK && typeof type.target === "string" && type.target.length > 0;
2026-08-25 06:04:03 +00:00
if (tmp) {
items.push(type.target);
}
});
}
return items;
};