refactor(zalo): share outbound chunker

This commit is contained in:
Peter Steinberger
2026-02-15 00:42:42 +00:00
parent 0d0ebd0e20
commit 56bc9b5058
6 changed files with 81 additions and 90 deletions

View File

@@ -0,0 +1,10 @@
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());
}