Files
Moltbot/src/plugin-sdk/allow-from.ts
2026-02-15 01:15:43 +00:00

11 lines
356 B
TypeScript

export function formatAllowFromLowercase(params: {
allowFrom: Array<string | number>;
stripPrefixRe?: RegExp;
}): string[] {
return params.allowFrom
.map((entry) => String(entry).trim())
.filter(Boolean)
.map((entry) => (params.stripPrefixRe ? entry.replace(params.stripPrefixRe, "") : entry))
.map((entry) => entry.toLowerCase());
}