Files
outline/shared/editor/lib/embeds.ts
Tom Moor bf45e97641 chore: Enforce type import consistency (#10968)
* Update types

* fix circular dep

* type imports

* lint type imports and --fix
2025-12-19 23:07:02 -05:00

16 lines
353 B
TypeScript

import type { EmbedDescriptor } from "../embeds";
export function getMatchingEmbed(
embeds: EmbedDescriptor[],
href: string
): { embed: EmbedDescriptor; matches: RegExpMatchArray } | undefined {
for (const e of embeds) {
const matches = e.matcher(href);
if (matches) {
return { embed: e, matches };
}
}
return undefined;
}