shinclaw / src /plugin-sdk /allow-from.ts
HF Bot
chore: snapshot for Hugging Face Space
c91968c
Raw
History Blame Contribute Delete
356 Bytes
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());
}